searchReplace pm gref bitmap "plus" minus" sofar tchar ~(pm, fs > 0 graphic t,tl,sh (selectedtextlines lockScreen a1Loc ~(a1,tl) subheadings(outLineNumber(n,t)) k& sh curLevel indentLevel(tl) FALSE keyenter operatingMode value curmode source "off" notifybefore operatingmode oldBook notifyafter subHeadings t,tl,retval n,i,headingLevel,testLevel,prevTestLevel,retlinecount -- textLineNumber( ,t) -- find out what level -- point -- y, so outermost headinglevel -- walk through outline, grabbing everything that --one below current -- results 9& tl & -- a child a "+" tabs (ignoring "+" "-") preceding a counter xansitoChar(1) -- returns numbers form "1,3,2,1" etc -- based on a given outlineNumber , theText Zt,n,i,currentIndentLevel,retVal 1 -- only -- found -- elder sibling -- ''s descendant actual -- corresponds textlineNumber ZiLevel,n,iSibling, 1 -- foundNextSibling t) > -1 -- t) < -1 -- -- didn't expected older -- therefore specified isn't notifyAfter eresource notifyBefore ogoes "Use o, on widget." "You must 4copying f"Save" "Cancel" saveAs -- Drag drop outline arrangement -- Joseph Brick, November 93 -- This main dragAndDrop code: ZstartLine,endLine,lineHeight,mybounds,xloc,mytext -- Find Bclicked on. qwill be ustarting -- Break user G edge startline < 0 Uwe want n. we value -- later handler, we've a heading: endline -- lineheight pageUnits (see V below): -- Cache commonly used values xpix sysPageUnitsPerPixel ypix myBounds myText marker totalLineCount we know be between sides xLoc + xPix -- The following section selects B(s): -- lineList a list corresponding selectedTextLines -- we wish 9-- (We've count -- Walk down Zwe hit another -- incrementing needed: oselectedTextlines moves arrow up -- targetLine insertion point loop executes mousebutton released: mouseLoc -- above -- calculate Ucurrently -- - yPix there's beyond -- somewhere -- -- vertLoc -- lineYloc returns `location a given -- -- inside U(s): toward U(s) 1 place -- that we -- numLines -- targetline > CRLF & -- we asure moved -- -- original -- "," & font: occluded ( xhidden, but covered) "sizeSample" units lineNum,b, 2 - 1 - -- adjusts . Called adjustSize n * n + 3* v - 5* -- Slider control begins here -- NOTES ABOUT IDENTIFIERS -- s_slider prefix -> ZSTRING className = txClassName FALSE c"Thumb" setSliderLimits 4s_sliderv, s_sliderMin, s_sliderMax, s_sliderPosition A = loc -- & flag prevent updating mouse xmoved s_sliderV <> "HSliderThumb" B)), sldrPosition slidePos( "VSliderThumb" snapSlider( Q1 - glide width height thumbPosition, b(0,( j) /( value -- Another may be controlling OldMin OldMax j(1,( "vSliderThumb" pOffset ) * (1- newPos "hSliderThumb" -- Restore state ZSTACK detents = detentList catchRange M) < 0 -- Slider control begins here -- NOTES ABOUT IDENTIFIERS -- s_slider prefix -> ZSTRING className = txClassName c"Thumb" setSliderLimits 4s_sliderv, s_sliderMin, s_sliderMax, s_sliderPosition loc -- flag prevent updating mouse xmoved s_sliderV <> "HSliderThumb" B)), sldrPosition slidePos( "VSliderThumb" snapSlider( Q1 - glide = width = centered height = thumbPosition, b(0,( j) /( value -- Another may be controlling OldMin OldMax j(1,( "vSliderThumb" pOffset ) * (1- newPos "hSliderThumb" -- Restore state ZSTACK detents = detentList catchRange M) < 0 -- sets the thumb location specifed sliderPos value Zscale sliderMin sliderMax mySliderPos xPix sysPageUnitsPerPixel sliderBounds "bar" nearestPupp( oldP nearestPUPP( percentage newP x1 + (x2-x1-w)* sliderMove -- renumbers labels , numTics, tallTicSpacing adjustNumbers numFields w / ts j) / 5),10) curfield xCenter U(i*ts) ),10)+1 -- centers {horizontally on maximum && " invalid." mySliderMax minimum && " mySliderMin frequency tic marks on high U"0" U"0" FALSE myTallTicSpacing tics on > 50 must be a between 1 thumbWidth U"base" (x2 - x1) / leftMost curLine curline myNumTics gets above. -- notify handlers Mthese messages aren't handled. notifyBefore startSliderMove *endSliderMove -- returns whole pixel, pageunits val, Jprimary mouse primaryMouseButton linkDLL "user" getSystemMetrics( 23) > 0 unlinkDLL " --Copyright 1991-1994 Asymetrix Corporation gives you permission e, revise reuse the --individual scripts your own --applications. You may x, however, Sentire --substantial part redistribution jproduct. retains copyright on original elements . Include notice "Portions are they --contain copied --A note on language independence: For ease translating strings readers that come functions located --The names these letters: " toggleStatus openWindow 4memory, theStore, svNumFormat = TRUE [displays initialize up formats B"clear_all" l = 0 k = 0 "0" & sysDecimal & "00" o= default = FALSE --controls numbers, checks overflow, multiple --points, sets Jkey value generic 4last_key ") >= 16 continued 0's " = 0 --replace " = 0 "0." --append "0." keystroke --This performs calculations. If no values had been entered --saved, 're repeatedly hitting same operator , no action taken. If one passed jno other If two calculated previously stored their --result displayed scrollable tape. val1. new_op op, savekey --ignore hits on "+-x/") "+-x/")) --special equal sign x"mr" x"math" have .out dividing --only operation " = 0 strNoZeroDivide() under/ c strOverflow() c strUnderflow() handler intercepts strokes If a --calculator equivalent pressed, a Emessage sent corresponding ZSTRING keyAsChar "0123456789+-*/="& ("0") ("9") ("0")) = "*" = "x" = "=" posNum num isType(REAL, >= 0 strDisplayNumber fValue If there's no dec pt don't There's a "Can't divide -- Tim Pearson, Asymetrix 1/94 customEdit 4 s_answerMessages Z init, box, answers Z LONG i linkDLL sysToolBookDirectory & "tb40dlg.dll" STRING DialogCallback (WORD, &SetValue ( @ GetValue ( INT AddListBoxItem ( $DeletenListBoxItem ( EEnableControl ( GetControlText ( GetDialogFocus ( GetListBoxItems ( GetListBoxSelection ( GetnListBoxSelection( SetControlText ( SetDialogFocus ( SetListBoxItems ( SetnListBoxSelection( INT endTBKDialog ( = ",G3597,Answers: ,S3603, Send When Chosen: LISTBOX ,L3596, BUTtoN ,B3600,NODISMISS delete,B3601, ,B3602, #EDIT message,E3604, Iok,B1,TRUE J,B3606,FALSE" box = "524480,9,25,25,228,104,,, Multiple Choice,8,MS Sans Serif,,2,4,171,80,3597,1342177287,128, ,0,,5,59,125,7,3603,1342177280,130, ,5,17,124,39,3596,1352728577,131,,0, ,133,17,37,12,3600,1342242816,128,&Add,0, 133,31,37,12,3601,1342242816,128,& ,133,45,37,12,3602,1342242816,128,& ...,0, 5,69,124,11,3604,1350631552,129,,0,ok,178,7,44,12,1,1342242817,128,OK,0, J,178,22,44,12,3606,1342242816,128,Cancel,0" Bi - 1 i - 1 "listBox (windowhandle unlinkDLL y & " TBKDialogInit hDlg,ctrlId,hWnd,msg,ctrlName , cnt l"listbox U = textlineCount( o <= 1 TBKDialogCommand Z OBJECT thisLayer Z sel, foc, , newAnswer, cnt, answerCount, oldScript msg = 1 Caption:" r<> " Bsel = "Button cnt = ) + 1 &" & -1,0) " & 4 = <> NULL } ",sel) = cnt - 1 <= 1 foc = r<> " lockScreen ) - 1 < cnt ) - 1 > " & (i - 1) " & i &" & i = objLayer( B" && QUOTE & " " & i & " && buttonClick" & CRLF & \ TAB & " >" & editWidget" & }" & autoRadioButtons tbk_wid_name tbk_wid_props tbk_wid_values = i - 1 Bi - 1 i - 1 i - 1 i - 1 0) -- 0 = notifyBefore -- Tim Pearson, Asymetrix 1/94 customEdit 4 s_answerMessages Z init, box, answers linkDLL sysToolBookDirectory & "tb40dlg.dll" STRING DialogCallback (WORD, &SetValue ( @ GetValue ( INT AddListBoxItem ( $DeletenListBoxItem ( EEnableControl ( GetControlText ( GetDialogFocus ( GetListBoxItems ( GetListBoxSelection ( GetnListBoxSelection( SetControlText ( SetDialogFocus ( SetListBoxItems ( SetnListBoxSelection( endTBKDialog ( = ",G3597,Answers: ,S3603, Send When Chosen: LISTBOX ,L3596, BUTtoN ,B3600,NODISMISS delete,B3601, ,B3602, #EDIT message,E3604, Iok,B1,TRUE J,B3606,FALSE" box = "524480,9,25,25,228,104,,, Multiple Choice,8,MS Sans Serif,,2,4,171,80,3597,1342177287,128, ,0,,5,59,125,7,3603,1342177280,130, ,5,17,124,39,3596,1352728577,131,,0, ,133,17,37,12,3600,1342242816,128,&Add,0, 133,31,37,12,3601,1342242816,128,& ,133,45,37,12,3602,1342242816,128,& ...,0, 5,69,124,11,3604,1350631552,129,,0,ok,178,7,44,12,1,1342242817,128,OK,0, J,178,22,44,12,3606,1342242816,128,Cancel,0" Bi - 1 i - 1 "listBox (windowhandle unlinkDLL y & " TBKDialogInit hDlg,ctrlId,hWnd,msg,ctrlName , cnt l"listbox U = textlineCount( o <= 1 TBKDialogCommand { thisLayer Z sel, foc, , newAnswer, cnt, answerCount, oldScript msg = 1 Caption:" r<> " Bsel = "Button cnt = ) + 1 &" & -1,0) " & , = <> NULL u ",sel) = cnt - 1 <= 1 foc = r<> " lockScreen ) - 1 < cnt ) - 1 > " & (i - 1) " & i &" & i = objLayer( B" && QUOTE & " " & i & " && {" & CRLF & \ TAB & " }" & >" & editWidget" & }" & tbk_wid_name tbk_wid_props tbk_wid_values = i - 1 Bi - 1 i - 1 i - 1 i - 1 0) -- 0 = notifyBefore pointerObj "hand" -- returns the dialPos angle rotation dialMin dialMax startAngle endAngle angleRange -- sets its proper value syssuspendMessages coords "face" +)/2,\ radians) angleFromPoint (((Atan2(y-cy,x-cx)+2.5* )/(2* ))*360) -- handles dragging around dialMove endDialMove )/2,\ (ctr, dstart +360)) dend 3> 180 k360 > k360) numTics syssuspendmessages )/2,\ radius ) - ( ))/2 tallTicSpacing )/360 * (2 * PI) - (PI / 2) <= 10 curField curfield 500,200 centerPosition + ((1+sz*2) * + ((1+sz*2) * )*(i/ )), \ + ((1+sz) * + ((1+sz) * myNumTics mydialMax dialmin mydialMin myTallTicSpacing numtics myStartAngle myendAngle -- General handler. -- Supports single -- Joseph Brick, Oct 93. -- Notes about routine: -- ToolBook allows unrestricted values following . This a fully -- rotates these }. All other }are oriented along a 90 degree -- axis. just moves Owithout -- rotating their -- A note on storing polar coordinates: order converts Cartesian -- (stored %integers) h (manipulated %real numbers), When converted acan suffer rounding errors {may become more skewed each Iyou To avoid routines -- change shape distance running option, will have reset the Hsending storePolar -- Parameters: -- obj: Object be rotated. Can use toolbook {. Required. -- ctr: which P. Default structInfo[] xangle,yangle, ,cx,cy,radAngle,MouseAngle,longestH,storedAngle x,y,fp Zstack v,vtemp,loc Zgraphic curObj myRotation -- If xprovided, base b + ( b + ( a list objlist total vCount objCount -- loop goes once curObjType -- If -- kover: objList -- fsetable maliable isArcOrPie b + ( b + ( curVCount -- Add {reference -- -- walk through current y distances -- find length vector: undefined )x=0,y=0: dx=0 (dx,dy) +(dy,dx)- (rot/360)*(2* [vcount+i][1] array fa row -- Each stores a vertice. ,cx,cy, x,y,fp \ supplied /360) * 2* b + ( b + ( they already propsStored uprops I,ctr section resets repetition specified: -- -- adjust Hnewangle, x,y coorinates: countV curIndex ][2]+ 0][1] x(j = 1 (rd)*h f(rd)*h cxObj cyObj (rd)*h f(rd)*h iterate sized sysSuspendMessages b(sz), b(sz) -- stub notify handlers, sends notifyAfter enddialMove notifyBefore 4s_lheight notifyAfter linkStuff fontChange answers sized moved -- getting, setting the responses value answerList valCount drawLine i, valcount+1 -- drawing bleftN,rightN,setProp angLine leftRef rightRef leftTLBE textLineBeginEnd( rightTLBE leftX G+ 30 leftY rightX J- 30 rightY X+150, :-150, -- returns a list 3 numbers: -- 1: twips beginning -- 2: -- 3: lineheight leftmarg relativeLine n < 1 4-lh) * lh > 0,0,0 leftBound leftMarg rightbound +stringLen( midLine * lh - (stringHeight() s,rightBound, Bunder a point -- differs that will only there actually a textLineFromPoint mp b) > lh * ( -scr) tlineNum b +lh) b + ind windows stuff linkstuff X"gdi" getTextExtent( gselectObject( deleteObject( gcreateFont( linkDLL "user" ggetDC( releaseDC( makefont fontName,pitch, weight ghfont,hOldObject,hdc sysClienthandle) syspageunitsperpixel fheight ((1440/ /72)) -- pixels hFont <,0,0,0, ,0,0,0,0,0,0,0,0, "Failure: no logical created." -- kills destroyFont sysclienthandle, a given fref makeFont length str,strlen strLen retval = ( k65536) * "aaa",3) y65536) * -- change cursor resize entering default leaving handler resizes the splitter dragged ZstartPos X"user" getsystemmetrics( ( has swapped mouse buttons. >23) >0 leftMouseButton width navigation minwidth maxwidth leftWindow rightWindow leftWindowWidth clientSize wholeWindowWidth clientsize leftMost minWidth rightMost j(maxWidth, splitterBounds DC's ;windows, since we'll be drawing -- on hDCLeft getDC(clienthandle hDCright a pen hPen createPen(0,2,0) ! on ;DC's, storing old selected hOldObjectleft selectObject( hOldObjectMain modes oldROP2right setROP2( oldROP2left windowRef curDC oldP mousePosition oldp <> -- erase drawLine ,endPos we need switch DC's, release them deleteObject( releaseDC( hDCleft RightBorder currentpage leftwindow syspageUnitsPerPixel sizePage -- draws a specified DC endpos fromPoint PageUnitsToClient( toPoint moveTo( lineTo( T9^6I9w p8^8u4 Mouse browsing label Mouse browsing US map Washington capital Olympia Montana capital Helena Oregon capital Salem California capital Sacramento Nevada capital Carson City Idaho capital Boise capital Salt Lake City Wyoming capital Cheyenne Arizona capital Phoenix New Mexico capital Santa Fe Colorado capital Denver Texas capital Austin Oklahoma capital Oklahoma City Kansas capital Topeka Nebraska capital Lincoln South Dakota capital Pierre North Dakota capital Bismarck Minnesota capital St. Paul capital Des Moines Missouri capital Jefferson City Arkansas capital Little Rock Louisiana capital Baton Rouge Wisconsin capital Madison Illinois capital Springfield Kentucky capital Frankfort Indiana capital Indianapolis Tennessee capital Nashville Mississippi capital Jackson Alabama capital Montgomery Georgia capital Atlanta Florida capital Tallahassee North Carolina capital Raleigh South Carolina capital Columbia capital Columbus Pennsylvania capital Harrisburg West Virginia capital Charleston Virginia capital Richmond Maryland capital Annapolis Delaware capital Dover New York capital Albany New Jersey capital Trenton Vermont capital Montpelier New Hampshire capital Concord Maine &HnH} capital Augusta Massachusetts H4JBJ capital Boston Connecticut capital Hartford Rhode Island capital Providence Alaska capital Juneau Hawaii capital Honolulu 0-(-* H.@.* `/X/* Michigan capital Lansing <141* state/capital display capital state updateDisplay message sent Hthe map notifyBefore updateDisplay stateName,capital state capital State Capital author updateDisplay Often in a CBT application, you want to give the subject a chance to study. This example highlights objects as the mouse passes over them, and puts the name of the highlighted object into a field. Note that groups of objects within the main group (such as the Hawaiian islands in the lower-left), highlight as a single unit. Note also that only named objects and groups highlight. The object representing the Great Lakes in the upper-right part of the map is not named. ASYM_BeenHere T6N8I9 Move your mouse cursor over the map to the right. The state under the mouse pointer highlights, and the name of that state and its capital city appear in the fields below the map. Slider label ASYM_BeenHere SliderG A slider is useful when you need a response from your subject that falls within a range. The slider widget sends the following messages: startSliderMove: sent when the user first clicks on the thumb sliderMove: sent constantly as the slider is being dragged endSliderMove: sent when the slider stops moving. Each of these messages includes the current position of the slider thumb as its parameter. Use the property browser to set the range and scale.1 The slider sends the message endSliderMove when its thumb is set to a new position. This message is handled by the group that displays the fish. (Degrees Fahrenheit) slider 0 > S mySliderMin mySliderMax mysliderPos myNumTics scaledSlider tbk_wid_name numTics tallTicSpacing sliderMin sliderMax sliderPos tbk_wid_props tbk_wid_values myTallTicSpacing thumb hSliderThumb txClassName button id 103 of page id 15 glide width false hilight myTrackPos Shuttle helptext Button 60.566666666666673 700333333333333344 80.50000000000001e-014 90066666666666669 10033333333333336 800.0000000000001 10000 Select the proper temperature for tropical aquarium. fishy ,"JU" ,"JK" Too hot! problem health Too cold! Just right. endSliderMove jmyhealth sickfish health jmyhealth health notifyBefore endSliderMove sliderPos >= 75 <=85 ohealth "good" "poor" M < 75 "Too cold!" "problem" { > 85 +hot!" "Just value "fish" "sickfish" myhealth sickfish problem Too cold!t. Initialize fishy sliderPos health slider initialize initialize buttonClick initialize sliderPos health "fishy" buttonClick --notifyBefore Initialize endSliderMove sliderMove startSliderMove Timer label ASYM_BeenHere Timer Use this timer widget when you want to limit the amount of time the subject has to answer questions or view material. You can customize the total amount of time on the clock, as well as the subject's time limit. For example, the script in the Initialize button sets the timer's total time to 60 seconds, and the time limit to 45 seconds. You can specify hours and minutes as well. Use the Property Browser to specify options. When time is up, the timer sends the message endTime.{ A notify handler in the Initialize button starts the timer running when the page is entered. When time is up, the timer sends the endTime message, which in this example is handled by the Initialize button. timer QuizTimer tbk_wid_name totalTime timeLimit tbk_wid_props tbk_wid_values mytotalTime totaltimeLimit curTime sweep quarter threequarters 45505 timeFormat (Seconds) Initialize timeLimit timer timeLimit startTime totalTime totalTime initialize initialize buttonClick initialize enterPage Time's up. endTime initialize totalTime "timer" timeLimit startTime buttonClick notifyBefore endTime 's up." Initialize endtime enterpage leavepage buttonstilldown F 4 4 K *ClassTbl* *ClassEntry* *PTABLE* *WINDOWSEG* *ICONRESTAB* *ICONRESSEG* *ICONRES* Background *OBJTABLE* *IDTABLE* *NAMETAB* Rectangle Ellipse RoundedRectangle Polygon IrregularPolygon AngledLine Curve PaintObject Picture Hotword *RHOTWORD* Group Stage Button Viewer ComboBox Field RecordField *TbxBase* & eld 4 bxBase* bxBase* Showing a web page label Showing a web page http://www.asymetrix.com internetBrowser C:\PROGRA~1\NETSCAPE\NAVIGA~1\PROGRAM\NETSCAPE.EXE internetBrowser C:\PROGRA~1\NETSCAPE\NAVIGA~1\PROGRAM\NETSCAPE.EXE http://www.asymetrix.com http://www.asymetrix.com http://www.boeing.com http://www.ibm.com http://www.nasa.com http://www.northrup.com http://www.nothrup.com http://www.sony.com Jump to URL combobox Jump to URL field These widgets will attempt to communicate via DDE with Netscape. If the communication fails, the widgets will read the registration database to locate any browsers associated with the *.htm extension. If a browser is found, it will be launched with the desired URL as an argument.. The combobox will store URLs previously entered to allow easy retrieval. $ &0G $@&0G Object Effect label Object Effect Single tbk_wid_name single_object_effect Single Object Multiple tbk_wid_name multiple_object_effect Multiple Objects &Button This effect works because of a subtle difference between ToolBook's sysLockScreen property and the Windows API function LockWindowUpdate. You can use these widgets as is for random effects, or alter the scripts to hardwire them to your favorite objects. ASYM_BeenHere Applies page navigation effects to individual objects. Slow-motion label ASYM_BeenHere Slow-motion Putting this script in a checkbox gives the user the option of slowing ToolBook down by a particular factor set in the script. This script is useful if you need to let the user slow down a process, such as an animation. notifyBefore idle if my checked set lt to lastTime of self set newTime to timeGetTime() -- change this number to change degree of slow-down until newTime - lt >= 100 set lastTime of self to newTime end if end idle notifyBefore enterPage send init end enterPage notifyBefore leavePage unlinkDLL "mmsystem" end leavePage notifyAfter make if target is self send init end if end make to handle init linkDLL "mmsystem" DWORD timeGetTime() end linkDLL set lastTime of self to timeGetTime() end init w, #? disablePage level page of this enterPage w, #? go to level page of this buttonClick prop_level invalid level for widget: background, book must be "background" or "book" level prop_level level First must be "Next", "Previous", "First", or "Last" invalid direction for widget: Next,Previous,First,Last disablePage direction direction prop_disablePage invalid disablePage: First, last must be "First" or "Last" disablePage prop_disablePage disablePage tabPressed tabname J,tabMode obtype tabNum buttonClick etabLimit Cannot set tab tabPressed myTabMode tabMode tabLimit myTabMode tabMode myTabHeight tabHeight myTabHeight tabHeight arrangeTabs myTabSpace tabSpace myTabSpace tabSpace w, #? manual false myNumTabs etabLimit Can only have Must have at least 1 tab arrangeTabs numTabs myNumtabs numTabs manual tabRef tabLabel tabHighlight tabHeight arrangeTabs myNumTabs obtype highlight myTabHeight sized w, #> myTabMode tname myNumTabs myTabSpace anchor arrangeTabs l7parseFileName keyChar .'+ +F getCurrentDrive fileExists FALSE setCurrentDirectory acceptFile drive vgetCurrentDirectory seperatePath selectFile uncheckLinks setCurrentDrive default update parseFileName vgetCurrentDirectory setCurrentDirectory jupdateFileInfo zeupdateDirectoryInfo update l7parseFileName selectFile uncheckLinks getFileAttributes seperatePath tb40dos.dll fileExists getFileAttributes getCurrentDrive getCurrentDirectory setCurrentDirectory setCurrentDrive checkLinks tb40dos.dll uncheckLinks acceptFile updateFileInfo updateDirectoryInfo resetObj wrkday daysInMonth field 9lresetObj 8weekDay counter :lresetObj buildcal calMonth calYear displayDate 034025036146 isLeapYear 144025036146 leapyear weekDay 31,28,31,30,31,30,31,31,30,31,30,31 leapyear daysInMonth 0,31,59,90,120,151,181,212,243,273,304,334 m,d,y isLeapYear Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday m/d/y dayOfWeek ,"JdY FALSE isLeapYear enterPage today V, #> mouseLoc marker count lineHeight targetLine lineList tlines llineYloc tline IvertLoc buttonDown lineHeight sizeSample lineHeight lineYloc marker lineHeight adjustSize enterPage KERNEL SHELL GlobalAlloc GlobalLock GlobalUnlock GlobalFree filesDropped s_WM_DROPFILES DragAcceptFiles DragAcceptFiles DragQueryFile DragQueryCount DragQueryFile DragQueryValue .'+ +F ,&H.& .'+ +F GlobalAlloc DragQueryCount filesDropped GlobalFree GlobalLock DragQueryValue GlobalUnLock dropFiles l_count 06cleanUp filesDropped DragAcceptFiles reader KERNEL SHELL s_WM_DROPFILES leavepage cleanUp (=FullPie PtStart false StartAngle defValues prevPie vVertices zeroAngle defValues newVertices PlotValues defValues plotValues plotValues risNumber zeroAngle .&, #> .&, #> .&, #> listBox answers QOtbk_wid_props invert of target = TRUE LISTBOX answers Button add Button ok button lGetDialogFocus to handle buttonDown Button edit edit message listbox answers to handle buttonUp Answer Caption: 4DeletenListBoxItem newAnswer endTBKDialog editWidget GetControlText =ManswerMessage AEnableControl send (answerMessage of target) to target GetListBoxItems to set editWidget send customEdit to item 1 of my objects Cancel wAddListBoxItem gobjLayer GetnListBoxSelection SetControlText GvSetDialogFocus BUTtoN cancel button delete SetnListBoxSelection Multiple Choice Answer & answer Button delete EDIT message SetListBoxItems jGetListBoxSelection sptbk_wid_values tbk_wid_name my invert = FALSE 2 s_answerMessages custom,editWidget TBKDialogCommand page,background objLayer reader customEdit reader enterPage author %Aag'n pointerObj ={rotation pointerObj angle dialMax startAngle endAngle /dialMax dialMin QendAngle startAngle 1-dialMin dialPos pointerObj angle startAngle dialMax endAngle /dialMax dialMin QendAngle startAngle coords 1-dialMin >{rotation dialPos angleFromPoint pointerObj endDialMove angle >9dialPos |angleFromPoint startAngle dialMax endAngle /dialMax 9adialMove >{rotation dialMin QendAngle startAngle coords 1-dialMin Field buttondown .', " C333333 C333333 centerPosition curField startAngle dialMax endAngle /dialMax mtallTicSpacing myNumTics dialMin QendAngle startAngle coords 1-dialMin numTics centerPosition LnumTics mydialMax LnumTics dialMax mydialMin LnumTics LnumTics dialmin mydialMax dialMax mydialMin dialMin myTallTicSpacing Lnumtics Lnumtics tallTicSpacing .myStartAngle Lnumtics Lnumtics startAngle Lnumtics myendAngle Lnumtics endAngle myNumTics numTics .myStartAngle startAngle myendAngle endAngle myTallTicSpacing tallTicSpacing Q+struct objlist group myRotation structInfo myRotation curObjType arc,pie line,curve,angledline,polygon,irregularPolygon,pie,arc storePolar myRotation rotation false propsStored group uprops myRotation objlist structInfo maliable Q+struct storePolar structInfo curObjType struct P+struct arc,pie rotation pointerObj Lnumtics structInfo Q+struct Lnumtics sized dialMove enddialMove Money label Money This field formats its value to a standard "spread-sheet" look..c The widget handles the leavefield message to reformat itself. Money Money tbk_wid_name $ 234.00 ASYM_BeenHere True and False label True and False T/F Buttons buttonDown = TRUE (answerMessage editWidget customEdit the handlers below suit your needs -- answerTrue "You chose" && answerFalse tbk_wid_name T/F Buttons tbk_wid_props editWidget tbk_wid_values custom,editWidget widgetParent answerMessage answerTrue &TRUE false answerMessage answerFalse &FALSE T/F Radio Buttons = TRUE (answerMessage editWidget customEdit the handlers below suit your needs -- answer1 "You chose" && answer2 answer3 answer4 tbk_wid_name CBT Buttons tbk_wid_props editWidget tbk_wid_values custom,editWidget widgetParent answerMessage answer1 Answer &1 answerMessage answer2 Answer &2 answerMessage answer3 Answer &3 answerMessage answer4 Answer &4 CBT Radio Buttons = 0 xTRUE y = y >= 0 tbk_wid_name Cant_Touch_This Can't Touch This Cant_Touch_This enterPage B"Cant_Touch_This" orig 3888,3532 ASYM_BeenHere The descendant of a practical joke, this widget suggests some possibilities for using ToolBook to create interactive games. Slow-motion label ASYM_BeenHere Slow-motion This widget is useful if you need to let the user slow down a process, such as an animation. The checkbox slows ToolBook down by a particular factor set in the script. I Slow-Motion nplastTime oplastTime newTime timeGetTime enterPage mmsystem leavePage oplastTime timeGetTime timeGetTime mmsystem notifyBefore lastTime newTime timeGetTime() - lt >= 100 unlinkDLL "mmsystem" notifyAfter DWORD lastTime Slow-Mo tbk_wid_name Slow-Motion Rainbow ,&H.& rainbowCount buttonStillDown notifyBefore Idle 4rainbowCount NULL) k10 = 0) sObj saveCol Ri + 1 sendnotifyBefore A Rainbow leavePage buttonStillDown enterPage label A dial is useful when you need a response from your subject that falls within a range. The dial widget sends the following messages: startDialMove: sent when the user first clicks on the pointer dialMove: sent constantly as the pointer is dragged endDialMove: sent when the pointer is released Each of these messages includes the current position of the pointer as its parameter. Use the property browser to set the range and scale. The dial sends the DialMove message as you drag the pointer. The field below the dial handles the dialMove message in a notify handler. myStartAngle myendAngle myTallTicSpacing tbk_wid_name scaleDial tbk_wid_props dialPos dialMin dialMax startAngle endAngle numTics tallTicSpacing tbk_wid_values myNumTics mydialMin mydialMax myRotation struct structInfo 605ti 70433333333333333 805.6666666666667 10099999999999999 950t3 80199999999999999 Display dialMove -- picks up message that dial sends notifybefore dialMove pos 59.79301442010294 Aa@!n dialMove enddialMove dialMove ASYM_BeenHere Dial 2 Dragging objects into bins label Dragging objects into bins This example shows an effective use of custom icons and OpenScript's drag and drop commands. When you start dragging an apple or orange, the object is hidden and the cursor is changed to the appropriate shape. Drag the apples and oranges into their respective baskets... oranges targetType orange apples targetType apple Apples Oranges New pile pile o fruit buttonclick pile o fruit enterPage buttonclick "pile o fruit" notifyBefore Restore pile pile o fruit buttondown beginDrag targetType objectType You missed the basket! You're mixing apples and oranges! endDrag drag >silently beginDrag endDrag destObj targetType "You missed the basket!" S <> objectType >'re mixing apples oranges!" objectType apple objectType orange objectType apple objectType orange objectType apple objectType orange objectType apple objectType orange objectType apple objectType orange objectType apple objectType orange objectType apple objectType orange objectType apple $ 4 Y objectType orange B R Y objectType apple ` p Y objectType orange objectType apple objectType orange enterPage ASYM_BeenHere Labels label Labels If you need to quiz the subject on elements in an illustration, a good method is to use dragging labels. Each label below is a widget that automatically handles dragging. The bicycle is a paint object, with a group of transparent graphic objects on top of it. If the label is dropped on a graphic object in this group, the label sends the group a message. The group, in turn, checks to see if the name of the graphic object matches the name of the label group. Drag the labels to the appropriate parts of the bicycle. target group chainRings toptube headTube deraileur gradeMe 1, #? 1, #? target group grade grade You got showWrongAnswers out of buttonclick buttonclick grade "You got" && %&& "out " && :& "." showWrongAnswers Grade me showAnswers target group showRightAnswers buttonclick buttonclick showRightAnswers Show answers toptube origLoc label Top tube bottomLine topLeft point topRight headTube origLoc label Head tube bottomLine topLeft point topRight chainRings origLoc 5949,2910 label Chain rings bottomLine topLeft point topRight Initialize initQuiz buttonclick initQuiz enterPage -- initQuiz handled Hnotify handlers buttonclick notifyBefore Initialize deraileur origLoc 5026,2910 label Deraileur bottomLine topLeft point topRight 4073,2910 ASYM_BeenHere initQuiz reader author enterPage 5949,2910 3195,2910 Matching Quiz label Matching Quiz The widget below is useful for creating a matching quiz. The two fields below use the OpenScript's drag and drop commands to draw lines from one column to the other. The widget has the userProperty answers, which is a list of numbers for each item on the left showing its corresponding match on the right. For example, if the subject matched left item 1 with right item 3 and left item 2 with right item 6, the userProperty answers would return "2,6" when queried. You can also set answers to a list, which will result in the lines being drawn to their appropriate positions. Drag and drop from left to right to match each artist with the appropriate movement. MatchingQuiz tbk_wid_name MatchingQuiz tbk_wid_props answers tbk_wid_values false "textlinefrompoint allowDrag BlineNum "textlinefrompoint beginDrag BlineNum endDrag reader author author enterpage allowDrag tlfp textlinefrompoint( beginDrag lineNum endDrag notifyBefore lineNum Monet Raphael Picasso Courbet Redon zanne right .', " "textlinefrompoint BlineNum edrawLine objectDropped false "textlinefrompoint targName allowDrop reader author author enterpage objectDropped sourceObj tlfp textlinefrompoint( drawLine lineNum allowDrop targName notifyBefore lineNum Realism Symbolism Post-impressionism Classicism Impressionism Romanticism Cubism gradeMe V, #? FManswers rightanswers score You got studentAnswers out of matchingQuiz buttonclick buttonclick studentAnswers answers "matchingQuiz" rightanswers 5,4,6,7,1,2,3 answerCount = (rightAnswers) score = 0 "You got" && E&& "out u& "." Grade me showAnswers GManswers matchingQuiz buttonclick buttonclick answers matchingQuiz 5,4,6,7,1,2,3 Show answers Initialize GManswers matchingQuiz buttonclick GManswers matchingQuiz enterPage -- initQuiz handled Hnotify handlers buttonclick answers "matchingQuiz" notifyBefore Initialize enterPage 'aracter paragraph leavepage reader author ASYM_BeenHere character 1, "j .', " minus searchReplace /searchReplace 0]outLineNumber minus indentLevel curLevel subheadings buttonDoubleClick keyDown .'+ + source /searchReplace curmode subheadings source operatingMode reader B7oldBook JFoperatingmode enterPage JFoperatingmode author JFoperatingmode reader source textLineNumber indentLevel subHeadings ,&H.& counter indentLevel indentLevel outlineNumber false indentLevel foundNextSibling textlineNumber A7oldBook minus Use copy, not cut, on this widget. Cancel B7oldBook You must save this book before copying this widget. ,"JdY 1,"EL barWeight defValues defValues PlotValues defValues plotValues Y=myPlotWeight plotValues risNumber barWeight PlotWeight X=myPlotWeight plotWeight ,&H.& risNumber eEmyPlotColors PlotColors dEmyPlotColors plotColors isNumber false showframe author showFrame enterPage showFrame author false showFrame reader .'+ +F linVertices vValLine oldCursor linObj defValues defValues PlotValues defValues plotValues ,"Jd" .', " .', " ,&H.& Y=myPlotWeight risNumber PlotWeight X=myPlotWeight plotWeight ,&H.& risNumber eEmyPlotColors PlotColors dEmyPlotColors PlotColors isNumber false showframe author showFrame enterPage showFrame author false showFrame reader FALSE txClassName Thumb setSliderLimits buttonDown 1,#!# false s_sliderPosition HSliderThumb s_sliderv VSliderThumb txClassName s_sliderMin s_sliderMax oslidePos 9sldrPosition buttonStillDown s_sliderV false snapSlider s_sliderPosition HSliderThumb VSliderThumb txClassName s_sliderMin s_sliderMax oslidePos sliderPosition buttonUp s_sliderV HSliderThumb VSliderThumb txClassName s_sliderMin s_sliderMax glide setSliderLimits slidePos 9sldrPosition sliderPosition newPos OldMax hSliderThumb pOffset group SliderThumb OldMin vSliderThumb txClassName s_sliderMin s_sliderMax thumb setSliderLimits sliderPosition 9sldrPosition sliderPosition detentList snapSlider txClassName Thumb setSliderLimits buttonDown 1,#!# s_sliderPosition HSliderThumb s_sliderv VSliderThumb txClassName s_sliderMin s_sliderMax oslidePos 9sldrPosition buttonStillDown s_sliderV snapSlider s_sliderPosition HSliderThumb VSliderThumb txClassName s_sliderMin s_sliderMax oslidePos sliderPosition buttonUp s_sliderV }[centered HSliderThumb height VSliderThumb txClassName s_sliderMin s_sliderMax width glide setSliderLimits slidePos 9sldrPosition sliderPosition newPos OldMax hSliderThumb pOffset group SliderThumb OldMin vSliderThumb txClassName s_sliderMin s_sliderMax thumb setSliderLimits sliderPosition 9sldrPosition sliderPosition detentList snapSlider sliderMove sliderMax sliderMin sliderMax sliderBounds sliderMin nearestPupp thumb mySliderPos nearestPUPP sliderPos sliderMax curfield numTics mtallTicSpacing sliderMin DxCenter LnumTics adjustNumbers xCenter mySliderMax sliderMin W\adjustNumbers is invalid. sliderMin sliderMax sliderMax sliderMax mySliderMin W\adjustNumbers is invalid. sliderMin ,&H.& myTallTicSpacing W\adjustNumbers tallTicSpacing curLine sliderMax sliderMin thumb sliderMax sliderBounds W\adjustNumbers sliderMin numTics must be a value between 1 and 50. myNumTics nearestPupp nearestPUPP leftMost numTics myTallTicSpacing tallTicSpacing mySliderMin sliderMin myNumTics numTics mySliderMax sliderMax mySliderPos sliderPos startSliderMove sliderMove endSliderMove nearestPUPP getSystemMetrics getSystemMetrics primaryMouseButton DialogCallback SetValue GetValue AddListBoxItem DeletenListBoxItem EnableControl GetControlText GetDialogFocus GetListBoxItems GetListBoxSelection GetnListBoxSelection SetControlText SetDialogFocus SetListBoxItems SetnListBoxSelection endTBKDialog vSetValue listBox answers 524480,9,25,25,228,104,,,Edit Multiple Choice,8,MS Sans Serif,,2,4,171,80,3597,1342177287,128,Answers:,0,,5,59,125,7,3603,1342177280,130,Text,0,answers,5,17,124,39,3596,1352728577,131,,0,add,133,17,37,12,3600,1342242816,128,&Add,0,delete,133,31,37,12,3601,1342242816,128,&Delete,0,edit,133,45,37,12,3602,1342242816,128,&Edit...,0,message,5,69,124,11,3604,1350631552,129,,0,ok,178,7,44,12,1,1342242817,128,OK,0,cancel,178,22,44,12,3606,1342242816,128,Cancel,0 tb40dlg.dll .&, #> .&, #> .&, #> Cancel QOtbk_wid_props wAddListBoxItem custom,editWidget LISTBOX answers button gobjLayer GetnListBoxSelection Button add SetControlText GvSetDialogFocus listbox answers Button delete send (answerMessage of target) to target SetnListBoxSelection endTBKDialog newAnswer GetControlText lGetDialogFocus answer Multiple Choice Button edit EDIT message listBox answers send customEdit to item 1 of my objects Answer & button delete Answer Caption: 4DeletenListBoxItem Button ok editWidget edit message Button cancel SetListBoxItems =ManswerMessage jGetListBoxSelection sptbk_wid_values tbk_wid_name AEnableControl to handle buttonClick 2 s_answerMessages GetListBoxItems to set editWidget TBKDialogCommand page,background objLayer reader customEdit reader enterPage author b;origLoc newloc getsystemmetrics getsystemmetrics checkObject dropTarget buttondown labelPosition b;origLoc initQuiz c;origLoc moved c;origLoc label topLeft topRight c;origLoc point bottomLine sized enterPage s_lheight leavepage linkStuff s_lheight FManswers GManswers s_lheight fontChange fontChange character fontChange paragraph FManswers right GManswers sized FManswers right GManswers moved false answerList edrawLine answers answerList answers leftRef rightRef false right angLine rightY leftTLBE rightTLBE answerList textLineBeginEnd answerList leftY drawLine lineheight stringLen leftBound rightbound midLine /$stringHeight textLineBeginEnd lineheight stringLen textLineFromPoint SIgetTextExtent selectObject deleteObject createFont getDC releaseDC linkstuff ,"JHY selectObject hOldObject }releaseDC Failure: no logical font created. getDC createFont hfont weight makefont .', " selectObject deleteObject hOldObject }releaseDC hfont destroyFont UdmakeFont destroyFont s_lheight /$stringHeight lineheight UdmakeFont destroyFont retval jogetTextExtent stringLen jogetTextExtent stringHeight nearestPUPP sliderMove sliderMax sliderMin mysliderPos sliderMax sliderBounds sliderMin nearestPupp thumb nearestPUPP sliderPos sliderMax curfield numTics mtallTicSpacing sliderMin DxCenter LnumTics adjustNumbers xCenter mySliderMax sliderMin W\adjustNumbers is invalid. sliderMin sliderMax sliderMax sliderMax mySliderMin W\adjustNumbers is invalid. sliderMin ,&H.& myTallTicSpacing W\adjustNumbers tallTicSpacing curLine sliderMax sliderMin thumb sliderMax sliderBounds W\adjustNumbers sliderMin numTics must be a value between 1 and 50. myNumTics nearestPupp nearestPUPP leftMost numTics myTallTicSpacing tallTicSpacing mySliderMin sliderMin myNumTics numTics mySliderMax sliderMax mysliderPos sliderPos sliderMove endSliderMove secsAngle totalTime kDcurTime sweep oldTime handVertices jDcurTime coords radius totalSecs clocktime ?handVertices myTotalTime totalTime 1, #b 1, #> minutes timeFormat quarter is not a valid time format. seconds threeQuarters myTotalTime hours MVmyRound totalTime myRound totaltimeLimit minutes totaltimeLimit timeFormat is not a valid time format. clockTime seconds totalTime totalTime hours timeLimit seconds totaltimeLimit timeLimit timeStart timeGetTime startTime buttonstilldown timeStart timeStart kDcurTime clocktime timeGetTime curTime totaltimeLimit 4endtime endtime timeStart kDcurTime clockTime leavepage timeGetTime mmsystem enterpage Etemplet enterField w, #> vgetCurrentDirectory getCu Self-sorting Field label Self-sorting Fielda tbk_wid_name lText scrambleText .'+ +F $scrambleText |sortSelf default buttonClick scrambleText ZSTRING unsortedText lText = "Sort" lTextCount = textlineCount( N& CRLF buttonClick sortSelf o= default scramble text and sort cancel Please supply a textline to insert. insertLine newLine buttonClick buttonClick ("Please supply a insert." r<> " newLine insertLine insert a textline tbk_wid_name APP850.FON APPS.INF ARCADE.BMP ARGYLE.BMP ARIALB.FON ARIALBD.FOT ARIALBD.TTF ARIALBI.FOT ARIALBI.TTF ARIALI.FOT ARIALI.TTF BLUEMAX.VXD CALC.EXE CALC.HLP CAN_ADF.EXE CANON10E.DRV CANON130.DRV CANON330.DRV CANYON.MID CARDFILE.EXE CARS.BMP CASTLE.BMP CGA.2GR CGA40850.FON CGA40WOA.FON CGA80850.FON CGA80WOA.FON CGALOGO.RLE CHARMAP.EXE CHARMAP.HLP CIT9US.DRV CITOH.DRV CLIPBRD.EXE CLIPSIBM.SHH CLIPSRV.EXE CLOCK.EXE COMM.DRV COMMCTRL.DLL CONTROL.EXE CONTROL.SRC COUR.FOT COUR.TTF COURBD.FOT COURBD.TTF COURE.FON DDEML.DLL DEC2150.WPD DEC2250.WPD DEC3250.WPD DECCOLOR.WPD DECLPS20.WPD DEMILAYR.DLL DEPCA.DOS DISK2 DISK8 DISK9 DISKA DISKB DOSAPP.FON DOSX.EXE DRIVERS.CPL DRWATSON.EXE DSWAP.EXE EGA.3GR EGA.DRV EGA.SYS EGA40850.FON EGA40WOA.FON EGACOLOR.2GR EGAHIBW.DRV EGALOGO.RLE EGAMONO.2GR EGAMONO.DRV EGAMONO.LGO EGAMONO.RLE EGAOEM.FON EGYPT.BMP ELNK3.DOS ELNKMC.DOS ELNKPL.DOS EPL75523.WPD EPSON9.DRV ESCP2.DRV EVX16.DOS EXECJET.DRV EXP16.DOS EXPAND.EXE FINSTALL.DLL FINSTALL.HLP GDI.EXE GENDRV.DLL HERC850.FON HERCLOGO.LGO HERCLOGO.RLE HERCULES.2GR HERCWOA.FON HERMES_2.WPD HIMEM.SYS HONEY.BMP HP_3P522.WPD HPIID522.WPD HPIIP522.WPD HPLANB.DOS HPMOUSE.DRV HPPCL.DRV HPPCL5MS.DRV HPPLOT.DRV HPSYSTEM.DRV HRMDG.SHH IBM39521.WPD IBM4019.DRV IBM5204.DRV IBMCOLOR.DRV IMPEXP.DLL IPX.OBJ KBDBE.DLL KBDCA.DLL KBDDV.DLL KBDFI.DLL KBDGR.DLL KBDHP.DRV KBDIT.DLL KBDNE.DLL KBDPO.DLL KBDSF.DLL KBDSG.DLL KBDSP.DLL KBDSW.DLL KBDUK.DLL KBDUS.DLL KBDUSX.DLL KEYBOARD.DRV KRNL286.EXE L300_493.WPD L630_52&.WPD LANGDUT.DLL LANGENG.DLL LANGFRN.DLL LANGGER.DLL LANGSPA.DLL LBPIII.DRV LMOUSE.DRV LMSCRIPT.EXE LMSCRIPT.PIF LSL.COM LVMD.386 LZEXPAND.DLL MAC586.SYS MADGE MAILMGR.DLL MAILSPL.EXE MAPI.DLL MCISEQ.DRV MIDIMAP.DRV MIS.SHH MMSYSTEM.DLL MMTASK.TSK MMTLHI.DRV MMTLLO.DRV MODERN.FON MORICONS.DLL MOUSE.COM MOUSE.DRV MOUSE.SYS MOUSEHP.COM MPLAYER.EXE MPU401.DRV MSADLIB.DRV MSD.INI MSHEARTS.EXE MSHEARTS.HLP MSMAIL.EXE MSMAIL.HLP MSNET.DRV MSREMIND.EXE MSSCHED.DLL MSSFS.DLL MT_TI101.WPD N2290520.WPD N2990523.WPD N890_470.WPD N890X505.WPD NDDEAPI.DLL NDIS39XR.DOS NE1000.DOS NE2000.DOS NEC24PIN.DRV NET.EXE NETAPI.DLL NETDDE.EXE NETH.MSG NETWARE.DRV NETWARE.HLP NETWATCH.EXE NETWORK.INF NOTEPAD.EXE NOTEPAD.HLP NWPOPUP.EXE OKI9.DRV OKI9IBM.DRV OL840518.WPD OLESVR.DLL OLIGRAB.2GR PACKAGER.EXE PACKAGER.HLP PANSON24.DRV PBRUSH.HLP PE2NDIS.EXE PIFEDIT.EXE PLASMA.DRV PMSPL.DLL POWER.DRV POWER.HLP PRINTMAN.EXE PRINTMAN.HLP PRO4.DOS PROGMAN.EXE PROGMAN.HLP PROPRINT.DRV PROPRN24.DRV PRORAPM.DWN PROTMAN.EXE PSCRIPT.DRV Q2200510.WPD Q820_517.WPD QWIII.DRV README.WRI RECORDER.DLL RECORDER.EXE RECORDER.HLP REGEDITV.HLP RINGIN.WAV RIVETS.BMP ROMAN.FON ROUTE.COM SCHDPLUS.EXE SCHEDMSG.DLL SEIKO_04.WPD SEIKO_14.WPD SENDFILE.DLL SERIFB.FON SERIFE.FON SERIFF.FON SETUP.EXE SETUP.INI SETUP.REG SETUP.TXT SF4019.EXE SHELL.DLL SL.HLP SMALLB.FON SMARTDRV.EXE SMARTND.DOS SMC_ARC.DOS SMC3000.DOS SMCMAC.DOS SNDBLST.DRV SQUARES.BMP SSERIFB.FON SSERIFE.FON SSMARQUE.SCR STORE.DLL SUPERVGA.DRV SYMBOL.TTF SYMBOLB.FON SYSEDIT.EXE SYSINI.WRI SYSTEM.DRV SYSTEM.SRC TASKMAN.EXE TBMI2.COM TCCARC.DOS TERMINAL.EXE TERMINAL.HLP TESTPS.TXT THATCH.BMP THINKJET.DRV TI850.DRV TIGA.DRV TIM17521.WPD TIM35521.WPD TIMES.FOT TIMESB.FON TIMESBD.FOT TIMESBD.TTF TIMESBI.FOT TIMESBI.TTF TIMESI.FOT TIMESI.TTF TKPHZR21.WPD TKPHZR31.WPD TOOLHELP.DLL TRIUMPH2.WPD TRNSCHED.DLL TTY.DRV TTY.HLP U9415470.WPD USER.EXE USREDIBM.SHH V7VDD.386 V7VGA.3GR V7VGA.DRV VADLIBD.386 VBROWSE.386 VDDCGA.386 VDDHERC.386 VDDTIGA.386 VDDTLI4.386 VDDVGA30.386 VDDXGA.386 VDMAD.386 VER.DLL VGA.3GR VGA.DRV VGA850.FON VGA861.FON VGA865.FON VGACOLOR.2GR VGADIB.3GR VGAFIX.FON VGALOGO.RLE VGAMONO.2GR VIPX.386 VNB.386 VNETBIOS.386 VNETSUP.386 VNETWARE.386 VPD.386 VPICD.386 VPOWERD.386 VREDIR.386 VSERVER.386 VWC.386 WFWNET.HLP WGPOMGR.DLL WIN.CNF WIN.SRC WIN386.EXE WIN87EM.DLL WINCHAT.EXE WINCHAT.HLP WINDOWS.LOD WINFILE.EXE WINFILE.HLP WINGDING.TTF WINHELP.EXE WININI.WRI WINLOGO.BMP WINMINE.EXE WINTUTOR.DAT WINVER WORKGRP.SYS WRITE.EXE WRITE.HLP WSWAP.EXE XGA.DRV XLAT861.BIN XMSMMGR.EXE ZIGZAG.BMPPPMMGR.EXE ZIGZAG.BMPXE COMM.DRV Q2200510.WPD SCHDPLUS.EXE SUPERVGA.DRV KBDHP.DRV SERIFE.FON VGA865.FON SYMBOL.TTF VREDIR.386 FINSTALL.HLP HIMEM.SYS V7VDD.386 N2290520.WPD DDEML.DLL MSMAIL.HLP HPPCL5MS.DRV SYSINI.WRI WINCHAT.EXE VDDXGA.386 ARIALBD.TTF POWER.HLP EGYPT.BMP SYSEDIT.EXE SSMARQUE.SCR IBM4019.DRV CHARMAP.HLP VDDTLI4.386 DECCOLOR.WPD HERCLOGO.LGO TIMESI.TTF ARIALBD.FOT SL.HLP README.WRI PACKAGER.EXE NETAPI.DLL LMOUSE.DRV CANON330.DRV EGA.3GR PRO4.DOS OKI9.DRV TIMESBD.TTF KBDGR.DLL VNB.386 EGA.SYS N890_470.WPD VNETSUP.386 COURBD.FOT HPPCL.DRV DISK8 ROMAN.FON KBDCA.DLL SERIFB.FON MOUSEHP.COM CGA.2GR PRINTMAN.HLP LZEXPAND.DLL DOSAPP.FON WIN.CNF ZIGZAG.BMP VBROWSE.386 TIM17521.WPD WINVER VNETBIOS.386 MOUSE.DRV QWIII.DRV PROGMAN.HLP WSWAP.EXE EPSON9.DRV PMSPL.DLL WORKGRP.SYS SSERIFB.FON MODERN.FON COMMCTRL.DLL WINFILE.EXEPP.EXE WRITE.HLP WSWAP.EXE XGA.DRV XLAT861.BIN XMSMMGR.EXE ZIGZAG.BMPDTIGA.386 CLIPBRD.EXE GLOSSARY.HLP TTY.HLP VCD.386 LANGGER.DLL SETUP.HLP PS1.DRV VGALOGO.RLE VWC.386 PROGMAN.EXE EGA80850.FON POWER.HLP FINSTALL.DLL N890_470.WPD TERMINAL.EXE LMSCRIPT.EXE NETWARE.DRV COMM.DRV MSREMIND.EXE MSNET.DRV HPLANB.DOS EGACOLOR.2GR MT_TI101.WPD ELNKPL.DOS 8514FIX.FONNN.HLP VCD.386 LANGGER.DLL SETUP.HLP PS1.DRV VGALOGO.RLE VWC.386 PROGMAN.EXE EGA80850.FON POWER.HLP FINSTALL.DLL N890_470.WPD TERMINAL.EXE LMSCRIPT.EXE NETWARE.DRV COMM.DRV MSREMIND.EXE MSNET.DRV HPLANB.DOS EGACOLOR.2GR MT_TI101.WPD ELNKPL.DOS 8514FIX.FONNNDOS FINSTALL.HLP CONTROL.SRC DECLPS20.WPD VPICD.386 KBDIT.DLL VGADIB.3GR CANYON.MID SYSTEM.SRC VDDTIGA.386 CLIPBRD.EXE GLOSSARY.HLP TTY.HLP VCD.386 LANGGER.DLL SETUP.HLP PS1.DRV VGALOGO.RLE VWC.386 PROGMAN.EXE EGA80850.FON POWER.HLP FINSTALL.DLL N890_470.WPD TERMINAL.EXE LMSCRIPT.EXE NETWARE.DRV COMM.DRV MSREMIND.EXE MSNET.DRV HPLANB.DOS EGACOLOR.2GR MT_TI101.WPD ELNKPL.DOS 8514FIX.FON VWC.386 WFWNET.DRV WFWNET.HLP WFWSETUP.CPL WGPOMGR.DLL WIN.CNF WIN.SRC WIN386.EXE WIN386.PS2 WIN87EM.DLL WINCHAT.EXE WINCHAT.HLP WINDOWS.LOD WINFILE.EXE WINFILE.HLP WINGDING.FOT WINGDING.TTF WINHELP.EXE WINHELP.HLP WININI.WRI WINLOGO.BMP WINMETER.EXE WINMINE.EXE WINMINE.HLP WINOA386.MOD WINOLDAP.MOD WINTUTOR.DAT WINTUTOR.EXE WINVER WORKGRP.SYS WRITE.EXE WRITE.HLP WSWAP.EXE XGA.DRV XLAT850.BIN XLAT860.BIN XLAT861.BIN XLAT863.BIN XLAT865.BIN XMSMMGR.EXE ZIGZAG.BMP ZIGZAG.BMP< This self-sorting field has scripts for sorting any text placed in it, and for inserting any textline in sorted order. To sort text in this widget field, set the text of the field to the text you want sorted, then send the field the message sortSelf. To insert a new line into the text, send the field the message insertLine with the text of the new line as a parameter..The "insert a textline" button has this script: clear sysError ask "Please supply a textline to insert." if sysError <> "cancel" set newLine to it send insertLine newLine to field "sort" endror ask "Please supply a textline to insert." if sysError <> "cancel" set newLine to it send insertLine newLine to field "sort" Scramble and Sort Insert ASYM_BeenHere Searching Field label ASYM_BeenHere Searching Field By typing in the field at the top, you can find an entry in the field below. In response to the enterPage message for this page, the scrolling field fills an array with its text. This helps speed the search that takes place after each keyDown message in the upper field. search search tbk_wid_name index .'+ + itemArray enterPage buttonUp notifyBefore 4ARRAY STRING itemArray[] fill B] order oselectedTextlines activate after again alias align angle application argument ascending background backgroundimage before bitand bitnot bitor bitshiftleft bitshiftright bitxor break caption changes character characters chars check chooseresource clear close closefile closeremote commandwindow conditions contains context continue createfile deactivate decrement default descending dimensions direction disable dynamic eighth eject enable excluding execute executeremote export extend fifth first fixed format forward fourth fxdissolve fxwipe fxzoom getremote graphic handle helptext import importgraphic increment insteadof items keepremote linkdll local locateonly magnify menubar menuenabled menuitem menuitemchecked menuitemenabled menustate middle minimized modal ninth normal notactive notifyafter notifybefore number openfile order pageimage password pause previous print properties readfile records reference remove request reset resource resourcecount resourcelist respondremote restore return scrollbar search second seconds seekfile select sendnotifyafter sendnotifybefore separator setmenuhelptext setmenuitemhelptext setmenuitemname setmenuname setremote seventh shift silently sixth speed spooler start store target tenth textfrompoint textline textlines third ticks topic transition translatewindowmessage uncheck unlinkdll unselect until untranslateallwindowmessages untranslatewindowmessage using variable variables while window within without words writefile seed seekfile select self send sendnotifyafter sendnotifybefore separator set setmenuhelptext setmenuitemhelptext setmenuitemname setmenuname setremote seventh shift show silently sixth slow sort speed spooler start step store target tenth textfrompoint textline textlines then third this ticks time to tool topic transition translatewindowmessage uncheck unlinkdll unselect until untranslateallwindowmessages untranslatewindowmessage using variable variables when while window with within without word words writefilefile enterPage Better Combobox label Better Combobox maxSize "LmaxSize enterDropdown enterDropdown maxSize = (dropDownItems lineCount scrollable = TRUE = FALSE tbk_wid_name BetterCombo tbk_wid_props maxSize tbk_wid_values list,1,2,3,4,5,6,7,8,9,10 maxSize Brenda Frank Brenda Willy This combobox knows to set the size of the dropdown field intelligently. This combobox will set the size of the dropdown field to the number of entries, but only if that number doesn't exceed a certain amount. That limit is in the userProperty of the combobox maxSize. If the number of dropdown items is greater than maxSize, the dropdown field gets a scrollbar... ASYM_BeenHere Drag a Textline label Drag a Textline DragTextline dragTextLine beginDrag +#,"" +#,I4 +#,"J +#,I4 2, #> +#,I4 dragTextLine stillOverDrop beginDrag dragTextLine oselectedTextLines = stillOverDrop pObject, loc currentTextLine currentTextline = &CRLF + 1 dragTextline = tbk_wid_name DragTextline smith You can drag any textline to a new position in the field below. This field allows you to drag a textline up or down and displays the results as you drag. ASYM_BeenHere Drag and Drop Text label Drag and Drop Text Drag_Drop_Text tbk_wid_name Drag_Drop_Text Drag&Drop: Select some text in this field and drag it to the other field s. One of the other fields allows drops, the other doesn't. Test, stest tetstetst stillOverDrop enterDrop stillOverDrop sourceObj, loc FALSE caretLocation enterDrop This widget enables you to select text, then drag it into another field. This widget allows you to drag any text out of it and then drop that text into any field that has its allowDrop property set to true. You can create such a field in the application you paste the widget into by drawing a field, then setting allowDrop to true from the Field Property dialog box. ASYM_BeenHere Drop_Target 06cleanUp leavePage ,&H.& dropFiles cleanUp cleanUp objs = c"OLE" "dropFiles" Multiple OLE Drag and Drop label Multiple OLE Drag and Drop Drag files from the File Manager into the field below. This field extends ToolBook's OLE capabilities by accepting multiple objects simultaneously, and by displaying the file names of the OLE objects. Just before each drop and at the leavePage message, the OLE objects already on the page are deleted and the text of the field is cleared. This is a function of the page, not the widget. dropFiles OLE Drop field tbk_wid_name enterPage reader leavepage cleanUp "month" "day" "year" value ZLONG days = daysInMonth() 5) + 1 %"00" %"00" < 1 outside range 1 %"00" k12) + 1 %"00" %"00" < 1 > 12 &&"out %"00" + 1) %"00" %"00" < 0 > 99 %"00" initialize 4OBJECT newHotwordID %"mm / dd / yy" m = m <> 2 "31,28,31,30,31,30,31,31,30,31,30,31" y = k4 = 0 k100 <> 0) k400 = 0) pointerObj "hand" dialPos angle rotation dialMin dialMax startAngle endAngle angleRange value syssuspendMessages coords "face" +)/2,\ angleFromPoint (((Atan2(y-cy,x-cx)+2.5* )/(2* ))*360) LOCAL INT outValue dialMove endDialMove )/2,\ (ctr, dstart +360)) dend 3> 180 k360 > k360) notifyAfter enddialMove numTics syssuspendmessages )/2,\ radius ) - ( ))/2 tallTicSpacing )/360 * (2 * PI) - (PI / 2) <= 10 curField curfield 500,200 centerPosition + ((1+sz*2) * + ((1+sz*2) * )*(i/ )), \ + ((1+sz) * + ((1+sz) * myNumTics mydialMax dialmin mydialMin myTallTicSpacing numtics myStartAngle myendAngle -- General handler. -- Supports single -- Joseph Brick, Oct 93. -- Notes about routine: -- ToolBook allows unrestricted values the following . This b fully -- rotates these }. All other }are oriented along a 90 degree -- axis. just moves }around Owithout -- rotating their -- A note on storing polar coordinates: order converts Cartesian -- (stored %integers) g (manipulated %real numbers), When converted acan suffer rounding errors {may become more skewed each Iyou To avoid routines -- change shape its distance running option, will have reset the Hsending storePolar -- Parameters: -- obj: Object be rotated. Can use toolbook {. Required. -- ctr: which O. Default structInfo[] xangle,yangle,radians,cx,cy,radAngle,MouseAngle,longestH,storedAngle x,y,fp Zstack v,vtemp,loc Zgraphic curObj myRotation -- If xprovided, base b + ( b + ( a list objlist total vCount objCount -- loop goes once curObjType -- If -- kover: objList -- fsetable maliable isArcOrPie b + ( b + ( curVCount -- Add {reference -- -- walk through current y distances -- find length vector: undefined )x=0,y=0: dx=0 (dx,dy) +(dy,dx)- (rot/360)*(2* [vcount+i][1] array fa row -- Each stores a vertice. ns,cx,cy, x,y,fp O supplied /360) * 2* b + ( b + ( they already propsStored uprops I,ctr section resets repetition specified: -- -- adjust Hnewangle, x,y coorinates: countV curIndex ][2]+ 0][1] x(j = 1 (rd)*h f(rd)*h cxObj cyObj (rd)*h f(rd)*h iterate sized sysSuspendMessages b(sz), b(sz) -- This message sent clicked changed Hsetting -- tabMode. Put code handler, -- on tabPressed tabNum -- handles clicking on buttonClick -- test 9was Hchecking "obtype" userProperty -- each named " ", N being tabname -- Changes which 9folder front. It does Hmoving U"mask" -- Value zbetween 1 tabs value < 1 > tabLimit() "Cannot 9" && -- moves visually -- appear See sized below adiagram v + xpix(), -- stores a userproperty myTabMode -- sends notification -- The handlers resizing ,mode. -- -- Used %a constant. Returns -- Note: you wish more , follow procedure: -- Go duplicate one -- Rename that 9appropriately. ( instance would -- be Tab7", thirteenth # be "Tab13"). -- Set its behind function reflect ZnumTabs() 9count pageUnits given n pixels. xPix n sysPageUnitsPerPixel * n yPix n Tel * n -- returns currently selected -- sets up height units. tabHeight myTabHeight handled tabSpace myTabSpace arrangeTabs valid parameter "Must have )least 1 "Can only /" && && " -- cache {reference optimization. 9"&i) i <= -- hidden %they've xbeen -- receiving them # are "manual" myNumTabs myNumtabs resized Notice -- methodSent: used differentiate =messages toolBook explicitly syssuspendmessages off toolbooks messaging, %we will be changing stuff. Without recursively -- calls itself over sysSuspendMessages thing has a called 5,6 _________ 7,8 3,4 | | 9,10 1,2 |____________| 11,12 -- Here amap -- goal here maintain shape -- . (Otherwise gets stretchy.) Also, -- should be -- find how tall supposed -- tabRef -- tsection makes " corners -- Need be sure -- wide 4doing m"tabHighlight" B"tabLabel" h (), 8 () -- -- editor. rectangular -- body -- following condition triggered %a whole , even though their sizes So we must notify can themselves. xarranged -- 9"&i) -- don't bother arranging -- x on -- assures aligned spaced evenly. anchor "tab1" where order xPos bp - b(ts,0) through remaining place -- 9"&i) ()+ts -- -- now tbit masking others. bchecks x(e.g., just moved tname 9" & above adjustLines curField M"&i) curLine curfield b + ( selectedChapter value chapterRef )"&i) pageID middleGray() lightGray midspot b + ( m"joiner"-- topicTree(v) -- you will probably want modify the following -- error handling execpt " FALSE "Couldn't navigate " && topicCount textlineCount( Nexist curtopicField M"&i) extractName(t) M"&i) U"1" plast U"bracket" k2 = 0 p1 + ( y2 + 1) 240,63.5,2.1875 values table contents -- e.g. " makeOutline tableOfContents "outline"" ZtopicList,curChapterField chapterCount "&i) "chapter1" keyEnter parseFileName checkLinks fileExists( acceptFile = -18 seperatePath( path = drive = getCurrentDrive() setCurrentDirectory( 0&":"& update , TRUE <> "\" setCurrentDrive( getCurrentDirectory( <> ".\" , FALSE sendnotifyBefore selectFile "", uncheckLinks o= default , directoryChange updateDirectoryInfo &":\"& updateFileInfo &":\"& , confirm "*.*" pathAndFile ZSTRING fileName & <> ".." x"\" x":") = ".\" getFileAttributes( linkDLL sysToolBookDirectory & "tb40dos.dll" INT unlinkDLL ry & " notifyAfter --stub keep causing ES no handler buildcal d, m, y wrkday = weekDay(1, m, y) "days" = NULL resetObj = LIGHTGRAY .BLACK ;RAISED counter = daysInMonth(m) i = d ;INSET KGREEN " && QUOTE & displayDate m, y %"M" comboBox "calMonth" = m Year" = y d, m, y SYSTEM leapyear LOCAL mfactor, cfactor day1, yr yr = leapYear = isLeapYear(y) G = "034025036146" ^ = "144025036146" y >= 1900 y <= 1999 y >= 2000 y <= 2099 y >= 1800 y <= 1899 y >= 1700 y <= 1799 y >= 2100 y <= 2199 (yr + (yr y4) + + d + m <> 2 "31,28,31,30,31,30,31,31,30,31,30,31" -- returns the weekday beyond 1/1/1700: -- note: requires full . Example: "1/1/1995") -- also ) function below dayOfWeek pdate aa list out %"m,d,y" "m/d/y" following each month) that have passed "0,31,59,90,120,151,181,212,243,273,304,334" numdays elapsed since 1/1/1700 (y-1700) y4-(y-1700) y100 +(y-1600) \ y400 + 365 * (y - 1700) + o+ d -1 m <= 2 k7 +1 "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday" -- Returns TRUE , FALSE -- NOTE: fuction a four digit Find 1992 (1992) k4 = 0 k100 <> 0) k400 = 0)) notifyAfter -- initialize buttonClick B"today" sortSelf ZARRAY dataArray[] ZSTRING sortedText array fill B] order quickSort -- convert dimensions( i] & CRLF trailing -- update o= default -- The tthree handlers aup a Standard recursive QuickSort. -- Keep mind that arrays are passed Hreference, Hvalue. fArray[] 4s_noSwap quickSrt ), 1, dlo, hi hi > lo j, lo, ((lo+hi) (lo+1) i] < s_noswap quicksrt , lo, +1,hi Ztemp -- use inserting a single U. Will maintain insertLine newLine insertLineAux( -- inserts txt, maintaining -- works only already ending ZinsertSpot midPoint middleLine -- looking )values less than current -- Kgreater -- exists > tlc 4ARRAY STRING itemArray[] ZWORD itemNumber, stringLength asure the array initialized \1] = sendnotifyBefore "index" Zkey so placed --lock screen speed closest match = TRUE --cache so I don't have zso many property lookups. --store length current we are searching numberItems = dimensions( there I want only one za binary --begining lphabetic that letter binarySearch( -- 8we found selectedTextlines more sequential -- currently Uwhich -- element less than -- sequentially "down" -- greater equal we reach + 1] < we dropped out because strings zshould be incremented so hilighted above + 1] = -- -- "up" -- ] >= > 1 - 1] >= -- our " = FALSE upper lower starting point currentPosition = ( DIV 2 --keep narrowing Zeither a no elements we throw <" half below exact was need further where --we Y we matches --we find a "up" - 1] buttonClick linkDLL "gdi" INT setBKMode(WORD, CreateFontIndirect(POINTER) ) Selectobject( OTextout( ^,STRING, nDeleteObject( user" GetDC( ReleaseDC( kernel" GlobalAlloc( DWORD) GlobalLock( GlobalUnlock( GlobalFree( sysToolBookDirectory & "tb40win.dll" clientFromPage( -- create the font Windows ZhLogFont,pLogFont, hFont, hPreviousFont, hDC, angle 66, 64) -- see pg 307 o SDK Programmer's Reference, vol. 3 -- ( entry LOGFONT structure) .(0, 0) -- Rheight, required -16 works but high resolution, large fonts. -- 2 width, default 0 -- 4 escapement below -- 6 ignored .(8, 0) -- weight, 500 = medium, 0 = don't care -- 10 -- 11 -- 12 -- 13 )(14, 2) -- output precision -- 15 clip -- 16 quality )(17, 0) -- pitch family, 32 Swiss, 0 1(18, ) -- faces will . Here we use Arial, most other TrueType -- let know who we are hDC = sysClienthandle) setBkMode( -- force repaint pageUnitsToClient( xPos = yPos = 3600 .( 4, , hDC) -- deal fdll refCount unlinkDLL " y & " notifyBefore PlotValues MaxBars >) - 1 !) > defValues NumBars vMin vMax bnds plotHeight .) / 2 < -1 -- Normalize values so they fit chart normConst -- Now -- Compute bar width barWeight / 100 barWidth b(30, blankWidth } - ( )) / ( oldLock -- Note: Object 1 always a " defining (i <= x, y1, x + plotValues PlotWeight isNumber( >= 1 <= 360 myPlotWeight plotWeight PlotColors myPlotColors H,L,S plotColors -- Automatically the "frame" used reference showframe notifyBefore showFrame -- This could be considerably optimized ]arrays typing the PlotValues oldCursor MaxLines >) - 1 MaxPoints >) / 2 cTextLineCount( g) > defValues NumLines vMin vMax vValLine NumPoints bnds plotHeight &) / 2 < -1 -- Normalize values so they fit chart -- Now -- Compute between points xIncrement ) / ( oldLock -- Note: Object 1 always a " defining (i <= linObj linVertices maxPoints j <= y - ( (j-1) * 2 + 1 plotValues PlotWeight isNumber( >= 1 <= 100 myPlotWeight j(8, b(1, y17)) plotWeight PlotColors myPlotColors H,L,S -- Automatically "frame" used reference showframe notifyBefore showFrame PlotValues MaxPies defValues NumPies vtotal FullPie vTotal > 1 -- Normalize values so they 1 (100%) -- fill pieChart -- Now bnds xCenter yCenter vRadius e) / 2 oldLock obj = (i <= CumulVal zeroAngle StartAngle PtStart ") * 6) * ptStart startAngle CumulAngle )) * A) * vVertices newVertices prevPie plotValues PlotOrigin isNumber( >= 0 <= 360 myPlotOrigin / 180) plotOrigin PlotColors myPlotColors H,L,S plotColors PlotValues MaxPies ) > 2 defValues NumPies vtotal FullPie vTotal > 1 -- Normalize values so they 1 (100%) -- fill pieChart -- Now oldLock pie1 pie2 bnds xCenter yCenter vRadius |) / 2 CumulVal zeroAngle StartAngle PtStart 2) * ptStart startAngle CumulAngle )) * A) * vVertices newVertices prevPie explodeBy explodeAngle ) * ( / 2))) + (ExplodeAngle), -( plotValues PlotOrigin result * 180 / ) > 1 isNumber( >= 0 <= 360 / 180 force redraw PlotColors myPlotColors H,L,S plotColors -- Tim Pearson, Asymetrix 1/94 customEdit 4 s_answerMessages Z init, box linkDLL sysToolBookDirectory & "tb40dlg.dll" STRING DialogCallback (WORD, & GetValue ( ?SetValue ( YGetnListBoxSelection( xGetControlText ( INT SetControlText ( -endTBKDialog ( = ",G3607,Answers: ,S3603, Send When Chosen: LISTBOX answers,L3596,TRUE" & CRLF & "FALSE EDIT message,E3604, BUTtoN ok,B1, J,B3606, box = "524480,6,25,25,186,74,,, True False,8,MS Sans Serif,,2,3,130,55,3607,1342177287,128, ,0,,5,32,125,7,3603,1342177280,130, 5,13,49,21,3596,1352728577,131,,0, 5,42,124,11,3604,1350631552,129,,0,ok,136,7,44,12,1,1342242817,128,OK,0, J,136,22,44,12,3606,1342242816,128,Cancel,0" "listBox (windowhandle e,box, Bok") = unlinkDLL y & " TBKDialogInit hDlg,ctrlId,hWnd,msg,ctrlName SetnListBoxSelection( TBKDialogCommand c = " z = 1 = 512 = "Button 0) -- 0 = notifyBefore -- Tim Pearson, Asymetrix 94 customEdit 4 s_answerMessages Z init, box linkDLL sysToolBookDirectory & "tb40dlg.dll" STRING DialogCallback (WORD, & GetValue ( ?SetValue ( YGetnListBoxSelection( xGetControlText ( INT SetControlText ( -endTBKDialog ( = ",G3607,Answers: ,S3603, Send When Chosen: LISTBOX answers,L3596,TRUE" & CRLF & "FALSE EDIT message,E3604, BUTtoN ok,B1, J,B3606, box = "524480,6,25,25,186,74,,, True False,8,MS Sans Serif,,2,3,130,55,3607,1342177287,128, ,0,,5,32,125,7,3603,1342177280,130, 5,13,49,21,3596,1352728577,131,,0, 5,42,124,11,3604,1350631552,129,,0,ok,136,7,44,12,1,1342242817,128,OK,0, J,136,22,44,12,3606,1342242816,128,Cancel,0" "listBox (windowhandle e,box, Bok") = unlinkDLL y & " TBKDialogInit hDlg,ctrlId,hWnd,msg,ctrlName SetnListBoxSelection( TBKDialogCommand ` = " w = 1 = 512 = "Button 0) -- 0 = notifyBefore --Save the initial Bthat was pressed compare }handler --toggle Akeyboard so only one inverted. 4initialButton, initialButtonClass "input" txClassName >= "ALPHA" toggleInvert >, "NON- --Check released over a different a buttonClick FToolBook will , invertedButton, invertedButtonClass objectFromPoint( 9s = " Us = " FALSE nlabel sysPageUnitsPerPixel), -( el * 5) --As mouse drug around Bdown buttons cursor passes them. Roff isChild( l), -( l * 5) {so I always }pairs. labelText = "Shift" = "Ctrl" = "Alt" = "Caps Lock" = "Tab" , TRUE = "Enter" keyEnter = "<-" notifyAfter --This takes care popping up inverting targetObject. toggleObject, class l), -( l * 5) l * 5) --returns objectInQuestion a child parentInQuestion acting The enter special because --parts. Zstack bnds,mouseOffset X"user" getsystemmetrics( * has swapped I buttons. =23) >0 leftMouseButton targ newloc = newLoc <> objectFromPoint( "base" dropTarget checkObject oorigLoc labelPosition value notifyBefore initQuiz moved -- 13,14 -- 11,12 9,10 sized pupp syspageunitsperpixel pwidth * 10 pheight * 10 topLeft mask topRight U"point" bottomLine sz > sz > syssuspendmessages distToP sz - Zstack bnds,mouseOffset X"user" getsystemmetrics( * has swapped I buttons. =23) >0 leftMouseButton targ newloc = newLoc <> objectFromPoint( "base" dropTarget checkObject oorigLoc labelPosition value notifyBefore initQuiz moved -- 13,14 -- 11,12 9,10 sized pupp syspageunitsperpixel pwidth * 10 pheight * 10 topLeft mask topRight U"point" bottomLine sz > sz > syssuspendmessages distToP sz - Zstack bnds,mouseOffset X"user" getsystemmetrics( * has swapped I buttons. =23) >0 leftMouseButton targ newloc = newLoc <> objectFromPoint( "base" dropTarget checkObject oorigLoc labelPosition value notifyBefore initQuiz moved -- 13,14 -- 11,12 9,10 sized pupp syspageunitsperpixel pwidth * 10 pheight * 10 topLeft mask topRight U"point" bottomLine sz > sz > syssuspendmessages distToP sz - nearestPUPP val,xpix sliderPos value Zscale sliderMin sliderMax mysliderPos sysPageUnitsPerPixel sliderBounds "bar" nearestPupp( thumb oldP percentage newP x1 + (x2-x1-w)* sliderMove adjustNumbers numTics otallTicSpacing numFields // ts j) / 2),10) curfield xCenter U(i*ts) ),10)+1 && " invalid." mySliderMax && " mySliderMin high U"0" U"0" myTallTicSpacing > 50 must be a between 1 thumbwidth U"base" (x2 - x1) / leftMost curLine curline myNumTics notifyBefore endSliderMove clocktime totalSecs = ototalTime -- test Ihas changed oldTime curTime coords "face" +)/2,\ radius X) - ( d))/2 secsAngle "sweep" handVertices( ,angle, j(.99, ") * (2 * PI) - (PI / 2))), \ j(.99, Y) * (2 * PI) - (PI / 2))),\ f(0 - (PI / 2))),\ (0 - (PI / 2))) myTotalTime value timeFormat adjustment "minutes" "hours" xa valid myRound( *.25) "quarter" *.5) "half" =num*.75) "threeQuarters" "zero" "(" & & ")" zval %".0" %".00" timeLimit totaltimeLimit clockTime startTime timeStart timeGetTime() notifyBefore - qs) y1000 b(0,ct) ct <= 0 endtime -- stub, so nothing handles message, we don't notifyAfter X"mmsystem" categories the "prompt" , selecting current Mbelongs that -- category. ( Ncan more than one myID myTopic label "Choose M" && ZmainStruct[][] categoryStruct fref arraySize dimensions( si][1] -- o i, -- selectedTextLine itemOffset( i][2]) > 0 -- kunless we are on selectedTextlines -- update compileCategories selectedTextLines -- walk through -- ) > 0 -- xalready assigned, i][2])=0 i][2] -- -- exists itemLoc i][2]) i][2] structure Show-off label Show-off RotateText tbk_wid_name RotateText Click me and watch me rotate leavePage This widget is a good example of using Windows directly from ToolBook to do something that is otherwise not possible in ToolBook. While it isn't usually necessary, you can link directly to Windows from ToolBook. This example takes advantage of a Windows capability not built into ToolBook. ASYM_BeenHere Simple Bar Chart label Animate Simple Bar Chart Use this widget to show up to 6 values. The buttons on this page all exercise the widget by setting its properties to the desired values. Set plotValues of the group to two numbers. The numbers will be automatically normalized to add up to 100%. Set plotweight to a number between 1 and 100. Set plotColors of the group to HLS color values or color names for the bars. Example: set plotColors of group "Chart One" to "green, 78,56,35""ample: set plotColors of group "Chart One" to "green, 78,56,35" of group "Chart One" to "green, 78,56,35"""5, 150 Note: The chart gets redrawn with the current values when you change the plotOrigin. Set plotColors of the group to HLS color values or color names for the two slices. Example: set plotColors of group "Chart One" to "green, 78,56,35"et plotColors of group "Chart One" to "green, 78,56,35"""ith the current values when you change the plotOrigin. Set plotColors of the group to HLS color values or color names for the two slices. Example: set plotColors of group "Chart One" to "green, 78,56,35" Chart one 1,0.715565031982942,0.526226012793177 defValues Weights barWeight BarChart tbk_wid_name PlotValues PlotWeight PlotColors tbk_wid_props tbk_wid_values myPlotWeight magenta,cyan,yellow,red,blue,green myPlotColors plotValues chart one buttonUp plotValues "chart one" 1,2,3,4,5,6 plotValues chart one buttonUp plotValues "chart one" 2345, 1678, 1234 plotColors blue,red,green,magenta,cyan,yellow chart one buttonUp plotColors "chart one" Color Scheme 1 plotColors magenta,cyan,yellow,red,blue,green chart one buttonUp plotColors "chart one" Color Scheme 2 .'+ +F .'+ +F plotValues plotValues chart one oldCursor plotValues tempVals chartObj buttonUp oldCursor -- This example recycles the current data shown -- chart {. In a real , you would -- some other -- Get [bar height, store display minimum chartObj = yone" plotValues = barCount = tempVals -- Now animation v = v < 0 incVal = -0.1 Animate plotValues chart one buttonUp plotValues "chart one" .1, -.5 plotWeight Chart one buttonUp plotWeight "Chart one" Bar Weight:: enterPage author reader Values 1,2,3,4,5,6 Values .1, -.5 Values 2345, 1678, 1234 Color Scheme 1 Color Scheme 2 ASYM_BeenHere Simple Line Chart label ASYM_BeenHere Simple Line Chart This widget plots up to 6 series of up to 25 points each. Just set its plotValues property to the data you want. Other properties control appearance details..o Set plotValues of the chart to a string containing as many as 6 textlines containing up to 25 numbers each. Values should be floating point numbers between -1 and 1, or any number. If a value exceeds -1 or 1, the values in the series will be normalized so that the highest one is assumed to be as high as the chart will allow. You can use any number of values but at least 2 and no more than 25 in any textline of the data. Example: set plotValues of group "Chart One" to "100,200,400,200" & CRLF & "123,345,523,234" Set plotWeight of the group to a relative thickness for the lines. This should be a number between 1 and 100. Example: set plotWeight of group "Chart One" to 60 Note: The chart gets redrawn with the current values when you change the plotWeight. Set plotColors of the group to up to 6 HLS color values or color names. Example: set plotColors of group "Chart One" to "green, magenta, red, blue, 34,56,75, 78,56,35" The line chart widget does not include marker lines. However, the bounds of the widget effectively define the plotting area, and the y = 0 line is a virtual horizontal line that goes exactly through the middle of the widget. The plotting area gets automatically hidden or shown when switching from reader to author level. Chart one barWeight -26, -33, 61, 29, 77, 81, -94, -16, -10 45, -15, -11, -15, 27, -51, -73, -7, -11 -45, -99, 90, 44, -80, 90, 52, 38, -99 37, 10, -9, -99, 47, -13, -82, -79, 77 -46, 81, -59, -7, -21, -22, 63, -13, -97 defValues LineChart tbk_wid_name PlotValues PlotWeight PlotColors tbk_wid_props tbk_wid_values magenta,cyan,yellow,red,blue,green myPlotColors myPlotWeight Color Scheme 1 plotColors blue,red,green,magenta,cyan,yellow chart one buttonUp plotColors "chart one" Color Scheme 1 Color Scheme 2 plotColors magenta,cyan,yellow,red,blue,green chart one buttonUp plotColors "chart one" Color Scheme 2 Plot random data plotValues chart one data set 1 buttonClick buttonClick plotValues "chart one" "data Plot data shown below Plot sin(x) ,&H.& plotValues Chart one buttonUp Zdata (i / 4) plotValues "Chart one" Plot y = sin(x) Data set 1 SetRandomData SetRandomData data numPoints (24)+ 1 numSets i > 1 CRLF (200) - 100 j > 1 -26, -33, 61, 29, 77, 81, -94, -16, -10 45, -15, -11, -15, 27, -51, -73, -7, -11 -45, -99, 90, 44, -80, 90, 52, 38, -99 37, 10, -9, -99, 47, -13, -82, -79, 77 -46, 81, -59, -7, -21, -22, 63, -13, -97, -72, 35, -63, 50, -94, 95, -76, -50, -70 8, 84, -50, 49, 26, 91-91, -72, 27, 46, -13, 40, -63, -72, 51, 70 -80, -60, -16, -1, 41, -32, -7, -82, 3, 70, 96, 76, 34, -61, -61, -65, -14, 0, -84, 31, -14, 55, 348, -41, 22, 50, 75, 83, 67, 22, -39 57, -69, 9, 38, -21, 99, -79, -17, -94, 38, -48, -66, -54, -62, 73, 53, -90, -3, -88, 93 Randomize Data AsetRandomData data set 1 plot random data buttonClick buttonClick "FALSE" setRandomData "data B"plot Randomize the data Line Weight plotWeight Chart one buttonUp plotWeight "Chart one" enterPage author reader Pie Chart label color1 ASYM_BeenHere Pie Chart This pie chart widget can plot up to 6 different values. The various buttons on this page change properties of the widget. Set plotValues of the group to up to 6 numbers. The numbers will be automatically normalized to add up to 100%. You can use any number of values but at least 2 and no more than 6 (to show more values, see below.) Example: set plotValues of group "Chart One" to "1000, 2000, 4000, 2000" Note that the chart will still be plotted correctly even if it is not perfectly round. However, since the size of the pies is calculated by angle, not by surface, this can lead to a distorted view of the data. Set plotOrigin of the group to a value in degrees which must be a number from 0 to 360. Example: set plotOrigin of group "Chart One" to 45 Note: The chart gets redrawn with the current values when you change the plotOrigin . Set plotColors of the group to up to 6 HLS color values or color names. Example: set plotColors of group "Chart One" to "green, magenta, red, blue, 34,56,75, 78,56,35" To plot more than 6 values, select the group, double-click it to select one of the pie objects inside, and use the clipboard to copy and paste as many copies of the pie object as you need inside the group. Set the color of the pies as you go, or set the plotColors property to your liking. Note that adding pies to this widget will slow it down.. .'+ +F .'+ +F Chart One plotOrigin buttonUp plotOrigin "Chart One" Chart One Claude authorName startangle false fullpie zeroAngle 6083, 4186, 5092, 9511, 3934, 3375 defValues 1540.5 vRadius yCenter 2287.5 xCenter PieChart tbk_wid_name PlotValues PlotOrigin PlotColors tbk_wid_props tbk_wid_values myPlotOrigin magenta,cyan,yellow,red,blue,green myPlotColors plotValues chart one buttonUp -%, #> buttonDoubleClick plotValues "chart one" Zdata (5) + 1 6083, 4186, 5092, 9511, 3934, 3375 plotValues chart one buttonUp buttonDoubleClick plotValues "chart one" Zdata (5) + 1 (10) 10,6,1,7,10 plotValues chart one buttonUp buttonDoubleClick plotValues "chart one" Zdata (5) + 1 (10) / 10 %" 0.0" 0.9, 0.9, 0.5, 0.6, 0.8, 0.2 chart one plotOrigin buttonUp plotOrigin "chart one" chart one plotOrigin buttonUp plotOrigin "chart one" chart one plotOrigin buttonUp plotOrigin "chart one" chart one plotOrigin buttonUp plotOrigin "chart one" chart one plotOrigin buttonUp plotOrigin "chart one" plotColors blue,red,green,magenta,cyan,yellow chart one buttonUp plotColors "chart one" Color Scheme 1 plotColors magenta,cyan,yellow,red,blue,green chart one buttonUp plotColors "chart one" Color Scheme 2 color2 Exploding Pie label Exploding Pie This pie chart shows two values only. One of the values gets plotted as an "exploded" wedge. The animation examples simply set properties of the widget.I Set plotValues of the group to two numbers. The numbers will be automatically normalized to add up to 100%. The second number will be shown in the "exploded" slice. Example: set plotValues of group "Chart One" to "10000,2000" Note that the chart will still be plotted correctly even if it is not perfectly round. However, since the size of the pies is calculated by angle, not by surface, this can lead to a distorted view of the data. Set plotOrigin of the group to a value in degrees which must be a number from 0 to 360, and a second number specifying the distance (in ToolBook units) by which to move the exploded slice. Example: set plotOrigin of group "Chart One" to 45, 150 Note: The chart gets redrawn with the current values when you change the plotOrigin. Set plotColors of the group to HLS color values or color names for the two slices. Example: set plotColors of group "Chart One" to "green, 78,56,35"""" Chart One B cE Degree 45 explodeBy Claude authorName startangle false fullpie zeroAngle Degree 0 defValues 1540.5 vRadius yCenter 2287.5 xCenter ExplodedPieChart tbk_wid_name PlotValues PlotOrigin PlotColors tbk_wid_props tbk_wid_values blue,red,green,magenta,cyan,yellow myPlotColors plotValues chart one plotOrigin buttonUp plotValues "chart one" plotOrigin 150,240 plotValues chart one buttonUp plotValues "chart one" chart one plotOrigin buttonUp plotOrigin "chart one" chart one plotOrigin buttonUp plotOrigin "chart one" chart one plotOrigin buttonUp plotOrigin "chart one" plotColors blue,red,green,magenta,cyan,yellow chart one buttonUp plotColors "chart one" Color Scheme 1 plotColors magenta,cyan,yellow,red,blue,green chart one buttonUp plotColors "chart one" Color Scheme 2 .'+ +F .'+ +F Chart One plotOrigin buttonUp plotOrigin "Chart One" .'+ +F .'+ +F false Chart One plotOrigin buttonUp odone plotOrigin "Chart One" i,i*2 false Animate .'+ +F .'+ +F explodeAngle false Chart One plotOrigin plotOrigin buttonUp odone explodeAngle plotOrigin "Chart One" Animate Values 10 to 1 Values 2 to 1 Degree 90 Animate 1 Animate 2 Color Scheme 1 Color Scheme 2 ASYM_BeenHere Sliders label Sliders horizSlider sldrPosition tbk_wid_name horizSlider centered txClassName HSliderThumb vertSlider sldrPosition tbk_wid_name vertSlider txClassName VSliderThumb Slider with graphic button Slider with line endbutton These widgets demonstrate how to make graphical sliders. The baseball slider uses a resource of the book; the pointer slider uses a line end. ASYM_BeenHere Ratchet label Ratchet slider tbk_wid_name slider ,&H.& 1,"JRY ,&H.& slider buttonDown -- This handler jumps the slider each tick mark mouse moved Zarray x[5], pin[4] i] = ((( U(i+1))-( Ui))/2 )+( x[i] = ( Ui)-82 pos = " = x[1] " = x[2] " = x[3] When " = x[4] " = x[5] slider emitting_Slider tbk_wid_name emitting_Slider slider@ ,&H.& 1,"JRY ,&H.& slider buttonDown -- This handler jumps the slider each tick mark mouse moved Zarray x[5], pin[4] i] = ((( U(i+1))-( Ui))/2 )+( x[i] = ( Ui)-82 pos = " = x[1] " = x[2] " = x[3] When " = x[4] " = x[5] slider2 track These ratchet sliders constrain the user's choices to certain values. Each widget allows itself to be set only at the hash marks. The user doesn't have intermediate values available, and this fact is reinforced by the visual feedback. The widget below also reports what mark it has been set to.set to. Face Plate 2 Back Plate 2 Face Plate 1 Back Plate 1 ASYM_BeenHere l!Z!u4 Scale Slider label Scale Slider slider mySliderMin mySliderMax mysliderPos myNumTics tbk_wid_name scaledSlider tbk_wid_props numTics tallTicSpacing sliderMin sliderMax sliderPos tbk_wid_values myTallTicSpacing thumb txClassName hSliderThumb glide button id 103 of page id 15 width hilight false myTrackPos helptext Shuttle Button 10.566666666666673 200033333333333344 30.50000000000001e-014 40006666666666669 50.53333333333336 60000000000000001 10000 emitter #00.00 sliderMove notifyAfter sliderMove pos arbitrary precision, comment the adjust zeros tpoint %"#00.00" integers tbk_wid_name scale_emitter 50.00569620253169 startSliderMove sliderMove endSliderMove sliderMove A sophisticated slider with a number of properties you can edit. The slider widget sends the following messages: startSliderMove: sent when the user first clicks on the thumb sliderMove: sent constantly as the slider is being dragged endSliderMove: sent when the user releases the thumb. Each of these messages includes the current position of the slider thumb as its parameter. You can set or get the following properties of the slider. sliderMin: Minimum value for the slider sliderMax: Maximum value for the slider sliderPos: Position of the thumb numTics: Number of tic marks that appear on the scale (max 50) tallTicSpacing: Frequency of tall tics on the scale. Each tall tic has a label below it. (up to 11 labels) These properties are easily accessed through the property browser.owser..in the tools30.sbk. ASYM_BeenHere Calculator label Calculator Calculator tbk_wid_name Calculator memory buttonClick buttonClick 4memory display memory last_key buttonClick buttonClick 4last_key, memory "display" -- display last_key memory buttonClick buttonClick 4memory, last_key "display" "mr" display memory last_key buttonClick buttonClick 4last_key, memory "display" --subtract calculate buttonClick buttonClick calculate ( LBdisplay buttonClick buttonClick display ( decimal clear display last_key buttonClick theStore buttonDoubleClick buttonClick 4last_key "display" Jkeystroke 4theStore, op --initialize temp value operator plusminusbtn display buttonup "display" * (-1) display buttonClick buttonDoubleClick buttonClick 09011997480157360e+036 A ten-key style calculator with memory. ASYM_BeenHere A regular old calculator, works great. functions a question widget) when an object that has the ASYM_Draggable property set to TRUE is dragged. Widget Properties (not all properties are valid for all question types) PROPERTIES VALUE PURPOSE ASYM_WID_AnsArray Array Contains all of the response definition data for the question. (see below) ASYM_WID_AnswerLocked Specifies whether the questL Validate Text, 2 label ASYM_BeenHere Validate Text, 2 These widgets validate the text after each keystroke.. The widget fields will only accept data of the type described in the fields to the left of the widgets. The test is made after each keystroke. The pattern for the first widget is a user property. Patterned text: Alpha - whitespace: AlphaNumeric - whitespace: Keystroke_FormatText NNN-AAA-*NN templet Keystroke_FormatText tbk_wid_name 345-yrt-434 Keystroke_Alphawhitespace ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz keyChar key, isShift, isControl ZSTRING characterTyped = ansitoChar( numberDigits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" Keystroke_Alphawhitespace tbk_wid_name widget widget Keystroke_Alphanumeric ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 keyChar key, isShift, isControl ZSTRING characterTyped = ansitoChar( numberDigits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" = 8 = 9 = 32 Keystroke_Alphanumeric tbk_wid_name jkljk34 33fjssssssssssssssssss Auto-scroll Recordfield label ASYM_BeenHere Auto-scroll Recordfield This script will force a recordfield's scrollbar to automatically appear when necessary. Note the difference between this script and the script for "Auto-scroll field." A recordfield resides on the background, but must be referred to by page, so we have to massage the object reference.from to handle showOrHideScrollbar get self obj = words 1 to 3 of it if textOverflow of obj > 0 or scroll of obj> 0 oldBorder of obj = borderStyle of obj set borderStyle of obj to scrolling else if oldBorder of obj = NULL oldBorder of obj = borderStyle of obj end set borderStyle of obj to oldBorder of obj end if notifyBefore enterPage send showOrHideScrollbar notifyAfter leaveField send showOrHideScrollbar notifyAfter keyUp send showOrHideScrollbar notifyAfter paste send showOrHideScrollbar notifyAfter cut send showOrHideScrollbar notifyAfter clear send showOrHideScrollbar "hideControls helpTemplate reader Using this &Template displayBitsPerPixel Displays help on using this template. categories getDC releaseDC lighterBlue Topics false tb40win.dll darkerBlue getDeviceCaps moveTo lineTo setROP2 createPen deleteObject selectObject navigationBar backcolor Tvpopulate numColors enterApplication helpTemplate leaveApplication CshowControls author 1,"J,()[];^=&.?': searchReplace hotword seconds Minute buttonup decrement minute increment is outside range 0 to 59 minute minute minute minute decrement increment out of range 1 to 12 decrement out of range 00 to 59 ;seconds increment seconds seconds seconds seconds hh : min : sec AMPM seconds minute newHotwordID initialize hotword newHotwordID hotword month buttonup .&, #? decrement daysInMonth is outside range 1 to increment decrement month increment month out of range 1 to 12 month month month decrement increment out of range 00 to 99 month mm / dd / yy newHotwordID initialize 31,28,31,30,31,30,31,31,30,31,30,31 month daysInMonth hotword newHotwordID .'+ +F .'+ +F cancel samples Enter a file name for this wave file. Cancel sample rate &Cancel record waveFile Please choose a clip first. Try a different name? save waveFile oldTimeFormat clip chooser This clip may cannot be played at this time. stopSpot Would you like to hear whatClip already exists. Try a different name? set waveFile channels bitsPer channels close waveFile bits/sample play waveFile from 0 wait set waveFile bitspersample set waveFile samplespersec open new type waveaudio alias waveFile buffer 5 stop waveFile startSpot cue waveFile input default fileName buttonClick waveAudio Stop Clip Please choose a clip first. cdAudio sequencer clip chooser jwhatClip whatClip The specified clip cannot be played at this time. closed jwhatClip Play Clip buttonClick waveAudio Stop Clip cdAudio successful sequencer mmplay mmnotify CLOSED whatClip jwhatClip Play Clip leavePage Play Clip enterPage jwhatClip CdresetContents enterpage CdresetContents 1, #> 1, #> ,&H.& soundList listToTextline whatWave GetWinIniVar sounds tb40win.dll listToTextline sound tb40dlg.dll GetWinIniVar *getWinIniVar filename resetContents filename whatWave selectChange pointerObj ={rotation pointerObj angle dialMax startAngle endAngle /dialMax dialMin QendAngle startAngle 1-dialMin dialPos pointerObj angle startAngle dialMax endAngle /dialMax dialMin QendAngle startAngle coords 1-dialMin >{rotation dialPos angleFromPoint pointerObj endDialMove angle >9dialPos |angleFromPoint startAngle dialMax endAngle /dialMax 9adialMove >{rotation dialMin QendAngle startAngle coords 1-dialMin Field buttondown dialMove enddialMove .', " C333333 C333333 centerPosition curField startAngle dialMax endAngle /dialMax mtallTicSpacing myNumTics dialMin QendAngle startAngle coords 1-dialMin numTics centerPosition LnumTics mydialMax LnumTics dialMax mydialMin LnumTics LnumTics dialmin mydialMax dialMax mydialMin dialMin myTallTicSpacing Lnumtics Lnumtics tallTicSpacing .myStartAngle Lnumtics Lnumtics startAngle Lnumtics myendAngle Lnumtics endAngle myNumTics numTics .myStartAngle startAngle myendAngle endAngle myTallTicSpacing tallTicSpacing Q+struct objlist group myRotation structInfo myRotation curObjType arc,pie line,curve,angledline,polygon,irregularPolygon,pie,arc storePolar myRotation rotation false propsStored group uprops myRotation objlist structInfo maliable Q+struct storePolar structInfo curObjType struct P+struct arc,pie rotation pointerObj Lnumtics structInfo Q+struct Lnumtics sized $b7 d copenMIDI program s_note hplayMIDI s_channel s_program s_hMidiOut s_volume buttonDown tstopMIDI buttonUp +#,"Y +#,"Y packDword s_channel s_note Unable to play MIDI device MidiOutShortMsg s_program s_hMidiOut s_volume playMIDI +#,"Y packDword s_channel s_note Unable to stop MIDI device MidiOutShortMsg s_hMidiOut s_volume stopMIDI freeWinPointer $bgetWinPointer MidiOutOpen mmsystem.dll KERNEL closeMIDI s_hMidiOut GlobalAlloc GlobalLock Globalhandle GlobalUnlock GlobalFree Unable to open MIDI device MidiOutGetNumDevs midiOutOpen MidiOutShortMsg MidiOutReset MidiOutClose MidiOutGetNumDevs No MIDI devices found openMIDI s_device B%MidiOutClose s_hMidiOut u0MidiOutReset closeMIDI GlobalAlloc GlobalLock getWinPointer GlobalFree GlobalUnLock Globalhandle Memory error occured. Operation Aborted. freeWinPointer packDWord copenMIDI enterPage copenMIDI reader closeMIDI leavePage closeMIDI author w, #? disablePage level page of this enterPage w, #? go to level page of this buttonClick prop_level invalid level for widget: background, book must be "background" or "book" level prop_level level First must be "Next", "Previous", "First", or "Last" invalid direction for widget: Next,Previous,First,Last disablePage direction direction prop_disablePage invalid disablePage: First, last must be "First" or "Last" disablePage prop_disablePage disablePage w, #? disablePage level page of this enterPage w, #? go to level page of this buttonClick prop_level invalid level for widget: background, book must be "background" or "book" level prop_level level First must be "Next", "Previous", "First", or "Last" invalid direction for widget: Next,Previous,First,Last disablePage direction direction prop_disablePage invalid disablePage: First, last must be "First" or "Last" disablePage prop_disablePage disablePage ,&H.& curLine curField topic adjustLines ,&H.& chapterRef pageID Chapter selectedChapter middleGray selected joiner false topics Zselected topicTree topics midspot chapter topic Couldn't navigate to page buttonDown .', " extractName plast bracket curtopicField midspot joiner topic No topics exist for this chapter. topicTree O@middleGray V, #> ,&H.& topics chapter1 chapter makeOutline extractName .'+ +F .'+ +F tb40win.dll GlobalUnlock GlobalAlloc DeleteObject setBKMode CreateFontIndirect Selectobject Textout DeleteObject }ReleaseDC GetDC ReleaseDC Selectobject clientFromPage GlobalAlloc GlobalLock GlobalUnlock GlobalFree dcTextout GlobalFree GlobalLock GetDC kernel CreateFontIndirect setBkMode buttonClick leavePage .isChild ,toggleInvert button [ebuttonPressed buttonUp \ebuttonPressed ,toggleInvert buttonDown .isChild ,toggleInvert buttonStillDown invertedButton invertedButton toggleInvert FALSE group isChild ,&H.& invertedButton .', #> ,&H.& .', #> .'+ + bckgrnds extractID sortTextLines intro,description and script,description and example,description only pageRef wsortTextLines tb40dlg.dll backRef label populate extractID navigationbar buttonclick Useful Patterns label ASYM_BeenHere Useful Patterns These widgets recognize data entered in a standard pattern of numbers.. Here are two widgets ready to go into your application. They both validate the data on keystroke, the first will only accept a valid social security number, the second a valid telephone number... Social Security Number: Keystroke_SSN ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz templet seperator ,.-/ alpha numeric characterTyped string 0123456789 Etemplet keyChar Etemplet enterField key, isShift, isControl templet = -- user property alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" numeric = "0123456789" seperator = " ,.-/" caretLocation = characterTyped = o(key) characterNumber = ( NNN-NN-NNNN templet Keystroke_SSN tbk_wid_name 123-45-6789 Keystroke_Phone ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz templet seperator ,.-/ alpha numeric characterTyped string 0123456789 Etemplet keyChar Etemplet enterField key, isShift, isControl templet = alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" numeric = "0123456789" seperator = " ,.-/" caretLocation = characterTyped = o(key) characterNumber = ( NNN-NNN-NNNN templet Keystroke_Phone tbk_wid_name 206-637-16000 Telephone Number: Add and Remove label Add and Remove Add_and_Remove tbk_wid_name Add_and_Remove Source FALSE allowDrop buttonClick buttonStillDown beginDrag endDrag allowDrop sourceObject FALSE buttonClick xenabled oselectedTextlines <> drag beginDrag endDrag targetobject tbk_wid_name Source Henry Harriet HarryrrietHenryet Henry Harry Destination FALSE allowDrop remove buttonClick buttonStillDown beginDrag remove endDrag allowDrop sourceObject FALSE buttonClick xenabled oselectedTextlines <> drag beginDrag endDrag targetobject tbk_wid_name Destination Harold Hildagaarddagaardietgaard destination Destination source buttonClick enterPage buttonClick ZINT thisLine selectedTextlines "source" "Destination" <> CRLF "destination" oenabled FALSE notifyBefore tbk_wid_name Add >> remove Destination source buttonClick enterPage buttonClick ZINT thisLine selectedTextlines "Destination" "source" <> CRLF oenabled FALSE notifyBefore tbk_wid_name remove << Remove enterPage You can move information back and forth between these two fields. You can also drag the text back and forth. Like the old Macintosh Font/DA mover, you can use this control to move information back and forth between a source field and a destination field. ASYM_BeenHere Directories and Files label ASYM_BeenHere Directories and Files These fields can navigate to and display information from your DOS directories. These five widgets provide a way to move around in the DOS file system. Changing items here actually changes what drive you are logged onto and what directory is current. &Directories directories directories tbk_wid_name CLIPART SAMPLES SETUP SPCLST TOOLS TUTORIAL WIDGETS WINAPI GENI_SP1 KIDSOFT MOUSE MSOFFICE MSWORKS MTB30 PERSONAL POWERPNT PRODIGY PSDWIN QUICKENW UTILITY WINCAKE WINDOWS WINFAX WINWORDS INPUT INSTVER LISTHORZ LOWPASS MACROHLP MAKEAPP MCITEST MEMORY MIDIMON MULTIPAD MUSCROLL MYPAL MYSCRIB OUTPUT OWNCOMBO OWNERB PALETTE PENCNTL PENPAD PRNTFILE PROFILER QWGDEMO REVERSE ROTARY SELECT SHOWDIB SHOWGDI SNOOP SORTDEMO SRVRDEMO TDOSMEM TIMERS TOOLHELP VERSTAMP WINMEM32 WMFDCODE XTENSION LAURELM HOURIR BRIANT CHARLESO ERIKR FRANKL DICKE BRUCEL MIYUKIH JOHNJ SARAHV TRANSFER CHARLES CHRISC CHUCKW CLAUDE STEVEW CATHYS ALLANF LENORAF CRAIG JOHNCO DANNS DARLENEM DAVEH KEVINB LINDAA DAWNM DEBBIE INGRIDF DENNISO STEVET GIGIL DOUGY TERRYL WHITEY SCOTT MIREIZ LORIJ CHARLESC TAMMYH AUSTRIA MITCHELL SWISS SAVER DENNISC DOUGK EPOCH SCOTTM MIKEF GER_CPL ELAINER MELODY JOHNGO SCOTTSC GREGE HARRIETL HARRYS CSC_TOM JACKIEV MIKEN JEAND JEFFA JOELK JEFFU JENNIFER WHITNEYM JEREANG DICKH JANETS RANDYA JOHNA JOHNB JOHNC JOHNG JOHNT JONES JORDANS JOSEPHB JOSHB JULIE KATHERIN KEITHC YVETTEB DIDIERB LANCE LAURELC LISAA CSC_TAMY LORIP WAYNEW MARCS MARIEF BETHR MARKMA MARTY KIKIW RICKS BRIANH MICHAELS JEFFM DEBBIEP MIKEM MOUSE NADIMH NANETTE NORMS PAULD PAULG PAULM PHILP LOGOS DENNISL RICKE MICHELEC DIANED ROSSG ROSSH CHARLOTT SCREENS SHABBIR LISAM SARAHH SHELLEYH SHERRI SHIRLEY SHUANGL SKUSALES STEVEB STEVEBA STEVEBEC STEVENW SUSAND SUSANM SUZYS MARKR TERONU TRACEY TRAINING TYLERB SCOTS WHOWHERE WINNIE TONYA SUSANP DAVIDS SYPLUS JOHND DALEW JENNW JULIEP BETHH PRODUCTI MIKES MARGOTP MICHAELO STEVEC JANETL LYNNEP TYRONEF MIKEST KRISTINE BILLS SANDYW GAARL MIKEP BRADC SUSANH STEPHEN STEVEF D&rives Drives Drives tbk_wid_name Fi&les file list file list tbk_wid_name ANIMALS.WAV ANIMATE.ICO ANIMATE.TBK ASYM01.AVI AUTOEDIT.EXE AUTOEDIT.ICO BROWSER.EXE BROWSER.ICO CARHORN.WAV CBT_DEMO.AVI CBT_DEMO.ICO CBT_DEMO.TBK CBT1.TBK CBT2.TBK CBT3.TBK CBT4.TBK CHIRP.WAV COMPANY.NDX CONTACT.DBF CONTACT.ICO CONTACT.TBK DBEXCHNG.ICO DBEXCHNG.TBK DIALOG.HLP DIALOG.ICO DIALOG.TBK FEATURES.ICO FEATURES.TBK HANDBOOK.ICO HANDBOOK.TBK HANDBOOK.TXT LIBRARY.ICO LIBRARY.TBK MAPI.ICO MAPI.TBK NAME.NDX POP.WAV POPIN.WAV SAMPLES.HLP SCRAPBK.ICO SCRAPBK.TBK TAQUIN.BMP TAQUIN.ICO TAQUIN.TBK TMPLHELP.TBK VAULT.WAV WHOWHERE.DB WHOWHERE.ICO WHOWHERE.MB WHOWHERE.PX WHOWHERE.TBK WIDGETS.ICOTS.ICOD30.HLP MTB30.ATS MTB30.EXE MTB30.HLP MTB30.SBK MTB30ANM.SBK MTB30BAS.DLL MTB30BMP.DLL MTB30CBT.DLL MTB30CMP.DLL MTB30CVT.DLL MTB30EDT.DLL MTB30FLT.DLL MTB30LNL.DLL MTB30MM.DLL MTB30MM.INI MTB30MM.SBK MTB30NET.EXE MTB30RED.DLL MTB30RUN.EXE MTB30UTL.DLL MTB30XTR.DLL MTBPREFS.EXE PALED30.EXE PALED30.HLP PARADOX.ATS PATHANIM.HLP PCDLIB.DLL PCDXBMP.DLL PHOTO.DLL PRINTWND.SBK PXENGWIN.DLL REFSHELF.EXE RELNOTES.HLP RELNOTES.WRI SCRNCAMP.EXE SCRNCAMP.TXT SCRWALK.ICO SCRWALK.TBK SYSINFO.EXE TB30DB3.DLL TB30DLG.DLL TB30DOS.DLL TB30PDX.DLL TB30WIN.DLL TB30XTR.DLL TBKDB3.DLL TBKDLG.DLL TBKFILE.DLL TBKSHELF.EXE TBKWIN.DLL TBLOAD.EXE TEST.EXE TEST.TBK THUMB.SBK UTILS.ATS VEAMAA51.LEX WAVEED30.EXE WAVEED30.HLP WINCOMT.DLL WINCONST.HLP WRAPBAR.DLL WRKBNCHT.DLL Current Directory CurrentDirectory w, #> vgetcurrentDirectory getCurrentDrive drive updateDirectoryInfo notifyBefore updateDirectoryInfo path drive = getCurrentDrive() &":\"&getcurrentDirectory( CurrentDirectory tbk_wid_name D:\MTB40\SAMPLESETRIND1\PROBLEMDOSST\RESWDLGCK File Name file name file name tbk_wid_name ANIMATE.TBKE updateDirectoryInfo updateFileInfo acceptFile enterpage selectFile updateFileInfo updateDirectoryInfo selectFile activateInstance Time and Date label ASYM_BeenHere Time and Date These fields display the current date and time. AutoDate and AutoTime initialize themselves on the enterPage message with a notifyBefore handler. You can get and set the formats in which they show the date and time with any legal OpenScript time format. The widgets will set their default format and immediately update. For example, type the following script in the Command window: set format of field "autoDate" to "dd/mm/yy". autoDate format enterPage prop_format format prop_format format notifyBefore value oprop_format sendnotifyBefore autoDate tbk_wid_name format borderStyle tbk_wid_props list,none,rectangle,shadowed,inset,raised tbk_wid_values mm/dd/yy prop_format 09/07/9520, 1993 autoTime autoTime tbk_wid_name format borderStyle period tbk_wid_props list,none,rectangle,shadowed,inset,raised tbk_wid_values h:min:sec AMPM prop_format period timerID 8:45:01 AMM Auto date:nameer Auto time:nameer enterPage leavePage International Time and Date label ASYM_BeenHere International Time and Date These fields display the current date and time in the current international format. These widgets are just like the "Auto Date" and "Auto Time" widgets except that they determine their formats by referring to the sysIDate and sysITime international system properties.operties. autoDate myDate dd/mm/yy yy/mm/dd mm/dd/yy enterPage notifyBefore myDate = sysIDate %"dd/mm/yy" %"yy/mm/dd" %"mm/dd/yy" autoDate tbk_wid_name format borderStyle tbk_wid_props list,none,rectangle,shadowed,inset,raised tbk_wid_values mm/dd/yy prop_format 05/26/9540, 1993 autoTime period SetTimer widTimerStart KillTimer widTimerEnd hfwidTimerStart clockTick :timerID enterPage widTimerEnd :timerID leavePage hh24:min:sec clockTick h:min:sec :timerID clockTick notifyBefore linkDLL "user" WORD widTimerStart=SetTimer( ,DWORD) +End = KillTimer( translateWindowMessage windowhandle on 0x0113 clockTick otimerID operiod * 1000, 0) notifyAfter widTimerEnd( unlinkDLL " hWnd, msg, sysITime = 1 %"hh24: j:sec" autoTime tbk_wid_name format borderStyle period tbk_wid_props list,none,rectangle,shadowed,inset,raised tbk_wid_values h:min:sec AMPM prop_format period timerID 3:52:015PMM International date: International time: enterPage leavePage Calendar label ASYM_BeenHere Calendar A calendar that keeps itself current. This widget automatically shows the current date, and can be set to show any month in the years 1700 to 2100. Enough functionality is provided to make the scripts easily extensible. calendar calendar tbk_wid_name field "27" resetObj frame calYear HSbuildcal frame whatDate sCurrentMonth m d y sCurrentYear selectChange selectChange whatText 4sCurrentMonth, sCurrentYear whatDate = %"m d y" = TRUE buildcal "frame" = FALSE d 1700 calMonth HSbuildcal frame whatDate sCurrentMonth m d y sCurrentYear selectChange selectChange whatMonth 4sCurrentMonth, sCurrentYear whatDate = %"m d y" = TRUE buildcal "frame" = FALSE Mayober 109yy January 1 February 2 March 3 April 4 May 5 June 6 July 7 August 8 September 9 October 10 November 11 December 124 today HSbuildcal m,d,y displayDate sCurrentDay sCurrentMonth mydate sCurrentYear buttonClick buttonClick 4sCurrentMonth, sCurrentYear, sCurrentDay mydate = %"m,d,y" = TRUE displayDate buildcal = FALSE Field id 83 of Page id 2 lastObj strokcolor strokcolor enterPage Get Printer Resolution label ASYM_BeenHere Get Printer ResolutionA Windows allows us to learn about the way a device displays information by creating an "Information Context". We use the API calls "createIC" and "getDeviceCaps" with the name of the printer (retrieved from the win.ini). This method is capable of finding out just about anything you want to know about your printer or your display monitor. to handle buttonClick get printerRes() if it <> null request "This printer has a resolution of" && \ item 1 of it && "by" && item 2 of it && "dots per inch." else request sysError end if end buttonClick to get printerRes linkDll "GDI" WORD createIC (STRING,STRING,STRING,STRING) INT getDeviceCaps (WORD,INT) INT deleteDC (WORD) end linkDLL linkDLL sysToolBookDirectory & "tb40win.dll" STRING GetWinIniVar (STRING, STRING) end linkDLL LOGPIXELSX = 88 -- Windows constants LOGPIXELSY = 90 driverInfo = getWinIniVar("windows", "device") deviceName = item 1 of driverInfo if deviceName is NULL set sysError to "There is no printer attached." unlinkDLL "GDI" unlinkDLL sysToolBookDirectory & "tb40win.dll" return NULL end if deviceFile = item 2 of driverInfo devicePort = item 3 of driverInfo hDC = createIC(deviceFile,deviceName,devicePort,NULL) prnXRes = getDeviceCaps(hDC,LOGPIXELSX) prnYRes = getDeviceCaps(hDC,LOGPIXELSY) get deleteDC(hDC) unlinkDLL "GDI" unlinkDLL sysToolBookDirectory & "tb40win.dll" return prnXRes & "," & prnYRes end printerRes Windows and DOS versions label ASYM_BeenHere Windows and DOS versionsE This script can retrieve and display the version numbers for DOS and Windows. The Windows call GetVersion returns the running versions of Windows and DOS in a packed format. This script makes the link, makes the call, and unpacks the information for you, displaying it in a readable form. to handle buttonClick linkDLL "kernel" DWORD GetVersion() end linkDLL set verNum to GetVersion() set WverNum to verNum mod 65536 set DverNum to verNum div 65536 set majorNumber to WverNum mod 256 set minorNumber to WverNum div 256 set dmajorNumber to DverNum div 256 set dminorNumber to DverNum mod 256 request "Windows version:" && majorNumber & "." & minorNumber & CRLF & \ "DOS version:" && dmajorNumber & "." & dminorNumber -- deal with dll refCount unlinkDLL "kernel" end buttonClickk Windows or WfW label ASYM_BeenHere Windows or WfW1 This script distinguishes between Windows 3.1 and Windows for Workgroups. It checks to see if a driver necessary for Windows for Workgroups is loaded (wfwnet.drv), in order to determine which version of Windows is running. running. to handle buttonClick linkDLL "kernel" WORD getModuleHandle (STRING) end linkDLL if getModuleHandle("wfwnet.drv") is NULL request "Running Windows" else request "Running Windows for Workgroups" end if unlinkDLL "kernel" end buttonClickkkk Outline label ASYM_BeenHere Outline Use this widget to create a field you can use as an outline at Reader level. At Author level, you can set the level of the text in the outline by typing Ctrl+Tab. When the outline field is copied and pasted into another book, it retrieves the resources for the plus and minus bitmaps from the first book. outline Big green dogs Great Dane So-so Danes Lesser Danes Collie Doberman Small dogs Sheltie Wiener dog Froo froo dogs Chow Chihuahua Poodle Lap poodle Yappy poodle Snapping poodle Shitzu Cartoon Cats Hobbes Bill Fritz Presidential Cats Socks Bill source outline tbk_wid_name Book "D:\ARNOLD\OLDAPPS\LIBRARY.TBK" oldBook Dogs Big green dogs Small dogs Froo froo dogs Cats Cartoon Cats Presidential Cats Sheltie Wiener dog Froo froo dogs Chow Chihuahua Poodle Lap poodle Yappy poodle Snapping poodle Shitzu Cartoon Cats Hobbes Bill Fritz Presidential Cats Socks Bill enterPage author reader Book "D:\MTB35\SAMPLES\LIBRARY.TBK" Outline Rearranger label ASYM_BeenHere Outline Rearrangera You can move individual textlines or whole sections, by dragging the textlines in the field. Tabbed textlines can be dragged up or down, and whole sections can be moved by dragging the textline at the head of a section. The indicator is an obscured line with a line end on it. There is a field covered by the main field, and we use the bounds of a hotword in the hidden field to find the height of a line of text.. Outline_Rearranger lineheight hotfield outfield outline_rearranger sizeSample adjustsize sized enterpage reader -- initialize the sized hotfield "sizeSample" outfield "outline_rearranger" ypix sysPageUnitsPerPixel syssuspendmessages adjustsize ylineheight o,3) notifybefore notifyAfter Outline_Rearranger tbk_wid_name sizeSample sizeSample outline_rearranger Frame Animation Introduction to Frame Animation Page Flipping Hiding and Showing objects Moving Objects Move By Move To The Position Property Useful Scripts Simulating Gravity Timing Animation Animating with Resources Simulating a Good 5 Cent Cigar Simulating a Good 5 Cent Cigar To The Position Property Simulating Gravity Timing Animation Simulating a Good 5 Cent Cigary Timing Animation The Position Property Moving Objects Move To Move By marker vertLoc vertLoc b value ypix = syspageunitsperpixel halfH B- 3* reader terpage enterpage Max Select Field label ASYM_BeenHere Max Select FieldE This widget limits the number of selectable lines in a multi-select list box. The handler can be placed in a system book or in the book or page script so it will work with more than one multi-select list box. It takes one parameter, Num, which represents the maximum number of selections allowed. To call the maxSelection handler use the following syntax: to handle buttonClick send MaxSelection 3 end buttonClick MaxSelect MaxSelect tbk_wid_name One One One Two Two Two Three Three Three Four Four Four Five Five Five Ex Select Field label ASYM_BeenHere Ex Select Field The Ex Select widget allows for an exclusive selection, acting like a single-select list box inside a multi-select list box. The XSelect handler allows multiple selections in a list box as long as the specified line is not selected. Once the specified line is selected, all other lines in the list box are unselected. This handler can be placed in a system book or in the book or page script, so it will work with more than one multi-select list box. The handler takes one parameter, XLine, which represents the line to make exclusive. To call the Xselect handler use the following syntax: to handle buttonClick send Xselect 5 end buttonClickkkk XLine Ex Select tbk_wid_name One One One Two Two Two Three Three Three Four Four Four FiveFiveFive f 1992 is a leap year. -- if leap itemOffset() origPage original itemOffset() label itemOffset()G A fast way to find the offset of an item in a list. For example, itemOffset("e","a,b,c,d,e,f,g") would return "5" Handlers: itemOffset (,) Parameters: : The item whose offset you are looking for. : The list in which you are looking. Note: to find out if the item is in the list, check if itemOffset is greater than 0..... -- finds the offset of an item in a list. to get itemOffset itm,lst step i from 1 to itemcount(lst) pop lst if itm = it return i end return 0 enddddddddddddddturn 0 ASYM_BeenHere Display 2-D array values request2Darray request2Darray x[][] Zretval dimensions(x) x[i][j] origPage original Display 2-D array values label Display 2-D array values Often, when debugging a script using arrays, you may want to display the array at a certain point in your script. This page has a handler for displaying the contents of two-dimensional arrays. Note that this also displays a standard method for walking through a 2D array. The button to the right fills an array with the elements of the list in the field. Once filled, it passes the array to the request2Darray handler (in this page script), which displays the contents of the array..ray. arrayField d,4,4/1/06 h,7,4/1/23 j,5,3/1/29 i,1,1/9/55 g,6,7/7/64 e,9,11/13/66 f,0,7/4/76 b,3,5/23/91 c,2,3/11/92 a,8,1/12/933 Display krequest2DArray arrayField buttonClick buttonClick Zx[][] fill x "arrayField" ] order request2DArray x Display ASYM_BeenHere Add number of days to date Add number of days to date This handler adds a specified number of days to a provided date. Note that a negative number of days can be supplied to subtract a number of days. Handler: newDate (,) Parameters: : Base date to which you want to add days : Number of days you want to add to Returns the modified date. -- function: newDate(,) -- Returns a date n days from a given date. Pass it a date -- for the first parameter, followed by an integer (positive -- or negative) representing the number of days from that date -- Example: to find out the date 10 days ago -- set x to newDate(sysdate,-10) to get newDate origdate, days format date origdate as "seconds" increment origdate by (days*24*60*60) format date origdate as sysdateformat from "seconds" return origdate endddddddddddddddddddddddddddddddddddddddddd origPage original Add number of days to date label ASYM_BeenHere 95051000165214669364226072 ASYM_TpID Controlling volume of clips label ASYM_BeenHere Controlling volume of clips Clips have a property called mmVolume, which you can set before or during play of a clip. This example uses a dial widget to control the volume of a clip. The dial widget sends out a dialMove message, which the Play Clip button handles..with a no Choose a clip, then play it while turning the dial to control the volume... Play Clip Play Clip Clip to play Clip Chooser CdresetContents enterpage CdresetContents clips whatClip resetContents notifyBefore resetContents notifyAfter [dropdownitems clips = resourceList( <> NULL whatClip &CRLF r"&"E& dropDownItems clip "Asymetrix Logo" clip "Asymetrix Logo" clip "bird1" clip "bird2" clip "bird3" clip "CD Audio" clip "Chirp" clip "lion" clip "No No No" clip "tiger" clip "toad" myStartAngle myendAngle myTallTicSpacing scaleDial tbk_wid_name dialPos dialMin dialMax startAngle endAngle numTics tallTicSpacing tbk_wid_props tbk_wid_values myNumTics mydialMin mydialMax &!V!i myRotation struct structInfo 40433333333333333 605.6666666666667 808t[# 10099999999999999 854t+$ 100t;% 96199999999999999 Display dialMove notifybefore dialMove pos 100639676273476528 &=a*' enterpage dialMove Aaz'n dialMove enddialMove description only description and example topicName description and script Untitled enterpage pageName templateButtons label subtopicname topicName chosen cancel keychar cancel -- initialize dialog box "Untitled" "topicName" B"description buttonclick -- sent user presses OK pageName chosen "templateButtons" -- the specified label "subtopicname" close -- handles OK escape keyEnter origPage original label ASYM_BeenHere in,false ThreeDeeRect bottomLine topLine Topic name: bottomLine topLine topicName Description and Example templateButtons chosen templates buttonclick buttonclick -- store selected a property chosen "templates" Description and Script chosen Description and Script Description and &Script Description Only Description &Only Description and Example Description and &Example Choose Template templates Description and script This is a description. Blah, blah, blah. Boy could I use another cup of Joe. Nothing is worse than work coffee. to handle buttonup do this do that description only description and script This is a description. Blah, blah, blah. Boy could I use another cup of Joe. Nothing is worse than work coffee. I've had so many cups of it already that I can see through time. Maybe some decaf is in orderrican butt. Description and example This is a description. Blah, blah, blah. Boy could I use another cup of Joe. Nothing is worse than work coffee. I've had so many cups of it already that I can see through time. Maybe some decaf is in order to handle buttonup do this do that buttonclick buttonclick cancel buttonclick buttonclick Cancel Untitleda web page description and script Get number of days in month Get number of days in month This handler returns the number of days there are in a month of a given year. Note that this handler requires the isLeapYear() handler, supplied below. Handler: daysInMonth (,) Parameters: : An integer representing the month : A four-digit year Returns the number of days in the supplied month for that year. -- function: daysInMonth(,) -- Returns the number of days in a month. -- NOTE: this function requires 4 digits for the year. -- This function calls the function leapYear() defined below. -- example: to find out how many days are in February, 1992 -- set x to daysInMonth(2,1992) to get daysInMonth m,y if m <> 2 return item m of "31,28,31,30,31,30,31,31,30,31,30,31" else if isLeapYear(y) return 29 else return 28 end -- Returns TRUE if y is a leap year, FALSE if not. -- NOTE: this fuction requires a four digit year. -- Example: Find out if 1992 is a leap year. -- if leapYear(1992) to get isLeapYear y if ((y mod 4 = 0 and y mod 100 <> 0) or (y mod 400 = 0)) return TRUE else return FALSE origPage original Get number of days in month label ASYM_BeenHere Create Full-Text Search Index label Create Full-Text Search Indexndex Creates an index of the current book for full-text searches. The index will use the default settings file (found in the Multimedia ToolBook directory). The index will be created in the same directory and have the same name as the the current book. Example of use: send buildIndexxxxxxxxxxxxxx -- this handler builds a basic full-text search index of the current book. to handle buildIndex -- display an hourglass cursor... this can take a while. sysCursor = 4 -- link the dlls required to build an index linkDll "fts40mtb.dll" STRING ftsRemoveIndex ( STRING ) DWORD ftsInitIndex ( STRING, STRING, WORD ) LONG ftsAddContext ( DWORD, STRING ) STRING ftsAddPage ( DWORD, STRING, STRING, STRING, LONG ) STRING ftsAddTextToSection ( DWORD, STRING, STRING ) STRING ftsAddSectionsToPage ( DWORD ) STRING ftsBuildIndex ( DWORD ) -- get the name of the index to use indexName = name of this book if indexName = NULL request "You must save this book before building an index for it." send cleanExit while "." is in indexName clear last char of indexName -- remove any existing index of that name get ftsRemoveIndex(indexName) -- initialize the index indexHandle = ftsInitIndex(indexName,sysToolbookDirectory&"default.sst",sysWindowHandle) if it = 0 -- if there is an error stop this process request "Error initializing index" send cleanExit -- step through the pages of this book step i from 1 to pageCount of this book pageRef = page i of this book bgRef = parent of pageRef -- if this background is different than the previous one -- get a list of objects on this background if bgRef <> curRef curRef = bgRef bgObs = getObjectList(bgRef,"field,recordField",FALSE) end -- get a title to associate with this page title = name of pageRef if title = NULL title = pageRef end -- add the page to the index get ftsAddPage(indexHandle,pageRef,title,"",1) if it = NULL request "Error Adding Page" send cleanExit end -- step through the list of fields and recordFields on this background -- and add their text to the default section of the index step j from 1 to itemCount(bgObs) curObj = item j of bgObs if object of curObj = "recordField" -- to get the text of a recordField we have to refer to a page rather than the background -- words 1 to 4 of a recordField reference are: "recordField id X of" curObj = words 1 to 4 of curObj && pageRef end textExp = "richText of"&&curObj get ftsAddTextToSection(indexHandle,textExp,"") end -- get a list of fields on this page and add their text to the default section of the index pgObs = getObjectList(pageRef,"field",FALSE) step j from 1 to itemcount(pgObs) curObj = item j of pgObs textExp = "richText of"&&curObj get ftsAddTextToSection(indexHandle,textExp,"") end -- add the text placed into sections to the index get ftsAddSectionsToPage(indexHandle) --build the index get ftsBuildIndex(indexHandle) if it = NULL request "Failed to build index." else request "Index successfully built." send cleanExit end buildIndex -- this process will exit the build process cleanly -- (removing the DLLs, etc.) to handle cleanExit sysCursor = 1 unlinkDLL "fts40mtb.dll" break to system end cleanExit ASYM_BeenHere {{{{{{{p{ wwwwwp wwwwwp wwwwwwp wwwwwwwp wwwwwwwp wwwwwwwp wwwwwwwp wwwwwwwp Perform Full-Text Search label Perform Full-Text Search -- this handler performs a basic search procedure on a full-text search index to get searchIndex queryString system lastQuery system DWORD numHits, currentHit local pageRef if queryString <> NULL sysCursor = 4 -- link the functions required for the search linkDll "fts40mtb.dll" DWORD ftsOpenIndex ( STRING ) STRING ftsCloseIndex ( DWORD ) DWORD ftsQuery ( DWORD, STRING, DWORD ) STRING ftsMatchRef ( DWORD, DWORD, DWORD ) end -- identify the index to search indexName = name of this book while "." is in indexName clear last char of indexName end -- open the index indexHandle = ftsOpenIndex(indexName) if indexHandle = 0 request "Could not open index" send cleanExit return NULL end --make the query numHits = ftsQuery(indexHandle,queryString,0) if numHits > 0 -- there was at least one hit if queryString = lastQuery -- the user is searching for the same string as the last search increment currentHit if currentHit > numHits currentHit = 1 end else currentHit = 1 lastQuery = queryString end -- get the page reference of the currentHit pageRef = ftsMatchRef(indexHandle,currentHit,0) end -- close the index get ftsCloseIndex(indexHandle) send cleanExit return pageRef -- this handler exits the search process cleanly -- (unlinking DLLs etc.) to handle cleanExit sysCursor = 1 unlinkDLL "fts40mtb.dll" enddddd get ftsCloseIndex(indexHandle) send cleanExit return pageRef -- this handler exits the search process cleanly -- (unlinking DLLs etc.) to handle cleanExit sysCursor = 1 unlinkDLL "fts30mtb.dll" This handler performs a search using an existing full-text search index. The index is assumed to be in the same directory and have the same name as the current book. This handler takes one parameter - the text for which to search - and returns a page reference for the first page on which that text appears. Searching with the same string again will return subsequent pages on which the text appears. Example of use: to handle buttonClick system lastQuery ask "Search For:" with lastQuery queryString = it pageRef = searchIndex(queryString) if isObject(pageRef) go to pageRef else request queryString&&"not found." ASYM_BeenHere Playing MIDI Directly label ASYM_BeenHere Playing MIDI Directly The button below plays MIDI sounds by making calls directly to the Windows Multimedia System DLL (mmsystem.dll) Click and hold Play MIDI to play a MIDI sound. Changing the Note field changes the note of the sound to be played. Changing the Program field changes what instrument plays the note... playMidi Play MIDI integerUp ,"J'" program spinUp w%spinUp buttonDown w%spinUp buttonDoubleClick w%spinUp buttonStillDown spinUp "program" < 39 integerDown program spinDown |spinDown buttonDown |spinDown buttonDoubleClick |spinDown buttonStillDown spinDown "program" > 0 program integerUp spinUp w%spinUp buttonDown w%spinUp buttonDoubleClick w%spinUp buttonStillDown spinUp "note" < 127 integerDown spinDown |spinDown buttonDown |spinDown buttonDoubleClick |spinDown buttonStillDown spinDown "note" > 40 Program: Note:am: keyboard custom,editWidget boolean boolean list,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 list,0,1,2,3,4,5,6,7,8 list,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127 list,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127 tbk_wid_values editWidget sustain gliss device channel program volume tbk_wid_props MIDI Keyboard tbk_wid_name dlgInit 524480,14,25,25,138,134,,,Dialog,8,MS Sans Serif,,3,3,76,38,3596,1342177287,128,Keyboard Settings,0,,3,43,77,74,3599,1342177287,128,MIDI Settings,0,,8,55,37,10,3604,1342177280,130,Text,0,,8,70,37,10,3605,1342177280,130,Text,0,,8,86,37,10,3606,1342177280,130,Text,0,,8,101,37,10,3607,1342177280,130,Text,0,gliss,8,15,48,9,3602,1342242819,128,&Gliss,0,sustain,8,27,48,9,3603,1342242819,128,&Sustain,0,program,46,54,27,121,3608,1350631491,133,,0,volume,46,69,27,121,3609,1350631491,133,,0,channel,46,84,23,66,3610,1350631491,133,,0,device,46,99,23,44,3611,1350631491,133,,0,ok,85,8,47,13,1,1342242817,128,OK,0,cancel,85,24,47,13,2,1342242816,128,Cancel,0 dlgBox gliss sustain program volume channel device Keyboard Help keyboard help buttonClick buttonClick "keyboard help" Keyboard Help Keyboard Help buttonClick buttonClick By sending messages directly to the DLL, the user is given much more precision. You can use the Ctrl key somewhat like the sustain pedal on a piano. Pressing Ctrl+Shift when you click a key acts as a MIDI "panic button" and shuts off any keys that might be ringing. You can set parameters by having the "reader rightclick" set to true and in reader mode using the Custom edit button on the right-click tool bar for any of the keys or the group "keyboard." If you are in author mode, you can set these same parameters from the property browser for the keyboard group. osing "Property Browser" from the Tools menu. the keyboard group and choosing "Property Browser" from the Tools menu. customEdit enterPage reader leavePage author Show all objects of page label Show all objects of page The script below displays all objects on the current page regardless of whether they are in groups. to handle showAll show getObjectList(this page,null,false) ASYM_BeenHere Disabling task switching label Disabling task switching# The script below allows you to turn on or off task-switching. When task-switching is on the user may not change tasks by using Alt+Tab, Alt+Shift+Tab, or Ctrl+Esc. They may still activate other windows by clicking on them. To turn off task-switching: set taskSwitching() to FALSE To turn task-switching back on: set taskSwitching() to TRUE to set taskSwitching to LOGICAL mode if mode untranslateWindowMessage 0x0112 for sysWindowHandle else translateWindowMessage for sysWindowHandle on 0x0112 send WM_SYSCOMMAND end to handle WM_SYSCOMMAND hWnd, wMsg, wp, lpLo, lpHi if wp <> 0xF050 and wp <> 0xF040 and wp <> 0xF130 --SC_PREVWINDOW, SC_NEXTWINDOW, and SC_TASKLIST forward to system ASYM_BeenHere QUICKENW UTILITY WINCAKE WINDOWS WINFAX WINWORDS INPUT INSTVER LISTHORZ LOWPASS MACROHLP MAKEAPP MCITEST MEMORY MIDIMON MULTIPAD MUSCROLL MYPAL MYSCRIB OUTPUT OWNCOMBO OWNERB PALETTE PENCNTL PENPAD PRNTFILE PROFILER QWGDEMO REVERSE ROTARY SELECT SHOWDIB SHOWGDI SNOOP SORTDEMO Icon Resources Save Text to a File (ASCII or RT Search and replace in a string Remove given char from string Remove given char from stringg This handler removes all instances of the specified character from the specified string. Handler: stripChar(,) Parameters: : any single character : the string from which to strip the character Returns the stripped string... -- removes all instances of chr from strng to get stripChar chr,strng set chrLoc to offset(chr,strng) while chrLoc > 0 clear char chrLoc of strng set chrLoc to offset(chr,strng) return strng stripChar stripChar chr,strng chrLoc origPage original Remove given char from string label ASYM_BeenHere Play clip on enter page label Play clip on enter page -- notifies for showing and closing clips notifyAfter enterPage -- these scripts could go in any object -- on the page or background -- clipRef of this page would -- already have the necessary reference clipRef = clipRef of this page if clipRef <> NULL mmOpen clipRef wait -- use this if the media is on a cd-rom -- mmCue clipRef wait -- show the first frame mmPlay clipRef in stage "myStage" of this background end enterPage notifyBefore leavePage clipRef = clipRef of this page if (clipRef <> null) and (mmIsOpen of clipRef) mmClose clipRef end if end leavePage These scripts play a clip upon entering a page and close it upon leaving the page. You could paste these scripts into any object. The clip to be played is identified by a user-property of the page and the clip is played in a stage object of the background. ASYM_BeenHere Chirp CD Audio bird1 bird2 bird3 tiger No No No Asymetrix Logo chirp.wav animals.wav animals.wav animals.wav animals.wav animals.wav animals.wav animals.wav asym01.avi AutoPageName Auto Page Name label ASYM_BeenHere Auto Page NameI This field automatically displays the current page name. This widget field uses a notifyBefore enterPage handler to set the text of the field to the name of the page. In order to see the field update if you name a page, you must send the enterPage message, or navigate away from the page and then return to it.d then return to it.turn to it.. autoPageName enterPage notifyBefore autoPageName tbk_wid_name tbk_wid_values AutoPageName enterPage Auto Page Number label ASYM_BeenHere Auto Page NumberE This field automatically displays the current page number.and page name.. This widget field uses a notifyBefore enterPage handler to set the text of the field to the number of the page. It must be activated by an enterPage message. autoPageNumber enterPage notifyBefore autoPageNumber tbk_wid_name tbk_wid_values enterPage Auto Buttons label Previous First Auto ButtonsU ToolBook automatically enables and disables these buttons. In the example below, they work on the page, but they should be pasted onto a background. ToolBook uses the same script and user properties to enable and disable these buttons depending on what page the buttons are on. To get and to set handlers determine what page ToolBook navigates to when the button is clicked and the page the button is disabled on. The caption of the button is also the actual command. Tools30.sbk includes information for widgets of this kind, and you can edit them from that sysBook. Make sure tools30.sbk is a system book. Right-click the button, click the Custom edit button on the right-click tool bar (just left of the Help button), and then double-click the value for the property in the "Browser" that appears.t-click tool bar (just left of the Help button), and then double-click the value for the property in the "Browser" that appears. AutoButtons AutoButtons tbk_wid_name autoDisable Navigation button tbk_wid_name level direction disablePage tbk_wid_props list,background,book list,Next,Previous,First,Last tbk_wid_values background prop_level direction prop_disablePage H ^ \ autoDisable Navigation button tbk_wid_name level direction disablePage tbk_wid_props list,background,book list,Next,Previous,First,Last tbk_wid_values background prop_level direction First prop_disablePage Previous autoDisable Navigation button tbk_wid_name level direction disablePage tbk_wid_props list,background,book list,First,Previous,Next,Last tbk_wid_values background prop_level direction prop_disablePage autoDisable Navigation button tbk_wid_name level direction disablePage tbk_wid_props list,background,book list,Next,Previous,First,Last tbk_wid_values background prop_level direction First prop_disablePage First enterPage ASYM_BeenHere Tab Widget label ASYM_BeenHere Tab Widget This widget can display from 1 to 6 tabs as shown below.] Pressing a tab sends the tabPressed message with the parameter of the tab number pressed. Currently, this message is handled in the widget; you'll have to forward the message if you want to handle it at the page or background. The widget should resize gracefully no matter what you do. Use the Group editor to resize the individual tabs. All handlers are in the folder group script. You can set the properties of this widget in MTB40.sbk. To change the number of tabs, set numTabs of the widget to a number between 1 and 6. Note: To add more than 6 tabs, see comments in the folder group script. To change the height of the tabs, set tabHeight of the widget to a number in page units. (Currently it's at 275.) To change the selected tab without clicking the tab itself, set tabMode of the widget to the appropriate number. To change the amount of space between each tab, set tabSpace of the widget to a number in page units. To change the labels on the tabs, change the caption of the button in the tab group using the right-click menu.u.button in the tab group using the right-click menu.i folder mytabheight myNumTabs myTabMode myTabSpace tbk_wid_name numTabs tabHeight tabMode tabSpace tbk_wid_props tbk_wid_values obtype tabHighlight tabLabel obtype tabHighlight tabLabel obtype tabHighlight tabLabel obtype tabHighlight tabLabel obtype tabHighlight tabLabel obtype tabHighlight tabLabel highlight Content Buttons label Content Buttons The buttons below act as a table of contents or an outline. The chapter headings on the left recognize their associated pages. The "buttons" (they are actually fields) on the right navigate to the pages with those names. Use the following command in the Command window to use the field at the upper-right to set the two levels of the outliner: set makeOutline of group tableOfContents to text of field "outline". Type Ctrl+Tab to indent subordinate items below the top-level text. outline outline tbk_wid_name Poodles Great Danes So-so Danes Siamese cats Fussy cats Decorator cats Cats who love dogs Gold fish Silver fish Sushiiiiiiiih sushihhhhhh tableOfContents tableOfContents tbk_wid_name Chapters chapter1 Poodles Great Danes So-so Danes topics pageID Dogse Animations chapter2 pageID Siamese cats Fussy cats Decorator cats Cats who love dogs topics Catsng Objectsns chapter3 Gold fish Silver fish Sushi topics pageID FishsesScriptsls chapter4 pageID Chickens 26 Goats 25 topics Farm Animals chapter5 chapter5' chapter6 chapter6 chapter7 chapter7 chapter8 chapter8M Topics topic1 pageId Poodles cats 26 59 topic2 pageId Great DanesShowing 253 topic3 pageId So-so Danesatsanesouces 61 topic4 pageId Cats who love dogs 62 topic5 pageId Move To 57 topic6 pageId Moving on Idle 64 topic7 pageId Tonyc7r7[ topic8 pageId Barbara8 topic9 topic9r8e topic10 topic108 bracket joiner ASYM_BeenHere Validate Numerical Data, 1 label Validate Numerical Data, 1o These widgets validate numeric data when the user leaves the field.. The widget fields will only accept data of the type described in the fields to the left of the widgets. The widget tests the data for the valid type when the user leaves the field. LeaveField_Number The value in the field must be a number. leaveField xisType(REAL, "The value must be a LeaveField_Number tbk_wid_name 034.344r LeaveField_Integer The value in the field must be an integer. leaveField x(isType(REAL, k1) = 0) "The value must be integer." LeaveField_Integer tbk_wid_name -123.5.444444 LeaveField_PosNumber The value in the field must be a positive number. leaveField x(isType(REAL, "The value must be a positive LeaveField_PosNumber tbk_wid_name 55.5444444444 LeaveField_PosInt The value in the field must be a positive integer. leaveField x(isType(REAL, k1 = 0) "The value must be a positive integer." LeaveField_PosInt tbk_wid_name 54345.5765444 Number: Integer: Positive Number: Positive Integer: bitamp sequencer overlay animation digitalVideo cdAudio photoCD videoDisk waveAudio minus minus Validate Text, 1 label ASYM_BeenHere Validate Text, 1 These widgets validate text when the user leaves the field.. The widget fields will only accept data of the type described in the fields above the widgets. The widget tests the data for the valid type when the user leaves the field. The first widget uses a pattern editable from the script. The third and fourth widgets use the sysDateFormat and sysTimeFormat.meFormat. LeaveField_Pattern ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz string does not match key: FALSE NNN-**-AA-NNN valid string ,.-*e tempKey alpha numeric seperator 0123456789 leaveField -- A key consists arbitray length four different -- "N" means the that must be a -- "A" (alpha. -- "-" 9seperator. -- Anything (we used "*") c"I don't care". -- Use establish your own = "NNN-**-AA- tempKey = key = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" numeric = "0123456789" = " ,.-*e" valid = TRUE FFALSE does xmatch key:" && LeaveField_Pattern tbk_wid_name 234-s@-WE-234444 LeaveField_Whitespace 2, "L ,"JA" ,"Ja" ,&H.& The characters in the field must all be in the alphabet. leaveField = 32 = 9)) < 65) > 90 < 97) > 122) "The must alphabet." LeaveField_Whitespace tbk_wid_name Foobar Barfoorrrrrrrrr LeaveField_Date not a valid date, use: leaveField xisType( xa valid r, use:" && LeaveField_Date tbk_wid_name 1/1/6555 LeaveField_Time not a valid time, use: leaveField xisType( xa valid I, use:" && LeaveField_Time tbk_wid_name 12:00:00 AM Pattern match: Alpha - whitespace: Date: Time: Bring up the Command Window Bring up the Command Window This one line script brings up the Command Window without using the Command menu item or the Shift + F3 key. Often you will want to remove menu items that you aren't using at Author level, but you still need the Command window while working. origPage to handle buttonClick show commandWindow end buttonClick original Bring up the Command Window label ASYM_BeenHere Bring up the Command Window Get day of week from date Validate Numerical Data, 2 label ASYM_BeenHere Validate Numerical Data, 2 The numerical value is validated after each keystroke. The widget fields will only accept data of the type described in the fields to the left of the widgets. The widget tests the data after each keystroke. Keystroke_Number 1234567890-+ 1234567890 characterPosition keyChar key, isShift, isControl ZSTRING characterTyped = ansitoChar( numberDigits = characterPosition = caretLocation j = "." ~(".", ) = 0 h> 0 X> 1) "1234567890-+" "1234567890" key = Keystroke_Number tbk_wid_name 4254.7644444444444444 Keystroke_Int 1234567890-+ 1234567890 keyChar key, isShift, isControl ZSTRING characterTyped "1234567890" caretLocation "1,0" "1234567890-+" Keystroke_Int tbk_wid_name -567563 Keystroke_PosNum 1234567890 1234567890+ keyChar key, isShift, isControl ZSTRING characterTyped = ansitoChar( numberDigits = "1234567890+" _ = "." ~(".", ) = 0 "1234567890" Keystroke_PosNum tbk_wid_name 98.56577577776565777 Keystroke_PosInt numberDigits 1234567890 1234567890+ keyChar key, isShift, isControl ZSTRING characterTyped = ansitoChar( numberDigits = "1234567890+" "1234567890" Keystroke_PosInt tbk_wid_name 8765408765444 Number: Integer: PosNum:er PosInt: Spin controls origPage original Spin controls label Spin controls Below are some standard spin controls for selecting an integer, date, or time. To use the date and time spinners, click on the segment of the date or time (e.g., month, minute) that you want to increment or decrement. Try out the spinners on the right. To use the date and time spinners, first click on the segment of the date or time (e.g., month, minute) that you want to increment or decrement. integerUp integer spinUp w%spinUp buttonDown w%spinUp buttonDoubleClick w%spinUp buttonStillDown spinUp "integer" integerDown integer spinDown |spinDown buttonDown |spinDown buttonDoubleClick |spinDown buttonStillDown spinDown "integer" integer dateButtons decrement dateUp increment month month actionItem buttonDown buttondoubleclick buttonStillDown "dateUp" actionItem selectedHotwords "day" "month" "year" dateUp dateDown increment evaluate(day) 03 / 13 / 944 month timeButtons decrement timeUp ;seconds increment seconds minute minute actionItem buttonDown buttondoubleclick buttonStillDown "timeUp" actionItem selectedHotwords "hour" "Time" "minute" "AMPM" timeUp timeDown increment evaluate(day) 08 : 42 : 45 PMM minute seconds ASYM_BeenHere Limit Length of Entry String origPage original Limit Length of Entry String label Limit Length of Entry Stringr This handler is to be installed into the script of a field. When a key is pressed, it checks that the charCount of the text of the field is within the limits specified in the script. This is a handler for a built-in ToolBook message that is sent to a field each time the user presses a key. Along with the keyChar message, Toolbook passes a parameter containing the unique code for the key pressed. Handler: keyChar keyPressedsseddddameters are: keyPressed the key pressed by the user -- does not allow entry of more than specified -- amount of characters. Place this handler in a field. to handle keyChar keyPressed local INT maxCharAllowed local INT currentCount maxCharAllowed = 10 currentCount = charCount(my text) if (currentCount >= maxCharAllowed) \ or (keyPressed = keyEnter and currentCount >= \ maxCharAllowed - 1) beep 1 else forward ASYM_BeenHere Limit Length of Entry String Cursor Resources Add number of days to date Check for Alpha Non-Numeric Data origPage original Check for Alpha Non-Numeric Data label Check for Alpha Non-Numeric Data This function checks each character to ensure that it is a letter from in the range of A-Z or a-z. To allow additional values or characters, you will need to add them to the string held in the variable "alphabet." Handler: isStringAlpha () Parameters: Returns true if the string contains only alpha characters or null. pha characters or null. true testString contained only alpha characters (A-Z or a-z) or NULL false testString contained at least one non-alpha character -- tests each character of testString, returns TRUE -- if all are alpha (non-numeric) to get isStringAlpha testString alphabet = "abcdefghijklmnopqrstuvwxyz" step i from 1 to charcount(testString) if char i of testString is not in alphabet return FALSE end return TRUE ASYM_BeenHere Bring ToolBook Window to Front Bring ToolBook Window to Front This script uses DDE to get the sysWindowHandle of another instance of ToolBook. It then calls Windows to bring that window to the front of the desktop. If that application is not running, it runs it. Handler: bringWindowToFront Parameters: : the name of theToolBook file to handle bringWindowToFront appNameToRun linkDLL "user" --bringWindowToTop is a Windows function that --puts the Window whose window handle is passed to it --in front of all the other windows. INT bringWindowToTop(WORD) end linkDLL --getRemote returns 9 separate items in sysError --item 1 is the status of the remote request getRemote "sysWindowHandle" application toolBook topic appNameToRun if (item 1 of sysError) is "OK" get bringWindowToTop(it) --bringWindowToTop doesn't size to page or even --restore it executeRemote "send SizeToPage" application toolbook \ topic appNameToRun else --the app isn't running, so we'll start it run appNameToRun end if end Front origPage original Bring ToolBook Window to Front label ASYM_BeenHere Bring ToolBook Window to Front Using windows pointers Resizing a polypoint object Initialize Excel Conversation Initialize Excel Conversation This function will run Excel if it is not running already. If a filename is passed to this function it will tell Excel to load that file if it is not loaded already. Handler: InitializeExcel () Parameters: optional; makes sure the file is open in Excel Returns true if it successfully established conversation with Excel false couldn't load Excel or, if provided, the file name given SysError values are those of the command executeRemote (see the OpenScript Encyclopedia). OK Conversation was succesfully established Failed:No Server Excel is not running with the expected file Failed: xxxxx Excel is running, but something is wrong to get InitializeExcel fileNameToRun --Get the current status of Excel getRemote "Status" application "Excel" topic "System" --If it failed because there is no server --run excel if item 1 of sysError = "Failed: No Server" run "excel.exe" && fileNameToRun getRemote "Status" application "Excel" topic "System" end --getRemote status should return Ready if it <> "Ready" return false end if --Make sure that it is not minimized executeRemote "[App.Restore()]" application "excel" --If no file has been specified then return successfully if fileNameToRun = NULL return true --Check to see if fFileName is open and, if so, --make it active executeRemote "[Activate(""" & fileNameToRun & """)]" \ application "excel" topic fileNameToRun --If it failed because there is no server then try --opening the file if item 1 of sysError = "Failed: No Server" executeRemote "[Open(""" & fileNameToRun & """)]" \ application "excel" --If sysError is OK then success if item 1 of sysError = "OK" return true return false X F u4 origPage original Initialize Excel Conversation label ASYM_BeenHere Initialize Excel Conversation label to handle enterApplication system s_backMessageSent -- initialize system variable s_backMessageSent = false -- turn off syshistory syshistoryrecord = false clear syshistory forward to handle leavepage system s_backMessageSent -- only puts page on syshistory if navigation is *not* initiated by BACK if targetWindow is mainWindow if s_backMessageSent is false push this page onto syshistory else s_backMessageSent = false end forward to handle back system s_backMessageSent if itemcount(syshistory) > 0 s_backMessageSent = true pop syshistory in mainwindow go to it end else request "You are already all the way back." Changing the behavior of BACK Changing the behavior of BACK These handlers, when placed in the book script of a ToolBook application, will make the BACK message behave like back behaves in WinHelp. Note: be sure you forward any leavePage handlers located in a page or background script. Handlers: EnterApplication LeavePage ASYM_BeenHere Spin controls Graphic slider control Check for Valid File Name Search Path for File Verbose Sorting a 1-D array label Sorting a 1-D array -- The next three handlers make up a Standard recursive -- QuickSort. to handle quicksort fArray[] by reference system s_noSwap set s_noSwap to 0 send quicksrt fArray, 1, dimensions ( fArray ) to handle quicksrt fArray[] by reference, lo, hi system s_noSwap if hi > lo send swap fArray, lo, ((lo+hi) div 2) set lst to lo step i from (lo+1) to hi if fArray[i] < fArray[lo] as text increment lst send swap fArray, lst, i else increment s_noswap end end send swap fArray,lo,lst send quicksrt fArray, lo, lst-1 send quicksrt fArray, lst+1,hi end to handle swap fArray[] by reference, x, y local temp set temp to fArray[x] set fArray[x] to fArray[y] set fArray[y] to temp end fArray[x] set fArray[x] to fArray[y] set fArray[y] to temp This is an OpenScript implementation of the standard recursive quick sort. Handler: quickSort Parameter: : A one-dimensional array. Example: local fArray[] fill fArray with my text in [textline] order send quickSort fArray ASYM_BeenHere Search Path for File origPage Search Path for File This script links to the function getDosEnvironmentString in TB40DOS.DLL to get the DOS path and then determines if the file is in that path. Handler: fileInPath () Parameters: file name to search for Returns null if file is not found, or the first directory in the path that contains the file if found. NULL file not found currentPath the first directory in the path that contains the file Null parameter no file name was passed to function name was passed to function to get FileInPath fileNameToCheck --If fileNameToCheck is null then fail immediately if fileNameToCheck is NULL then return null end if --Link to the tb40dos dll linkDLL "tb40dos.dll" INT fileExists (STRING) STRING getDOSEnvironmentString (STRING) end linkDLL --Get the path list set currentPathList to getDOSEnvironmentString ("PATH") --Clear the 'Path=' at the beginning of the path list get offset("=",currentPathList) if it > 0 then clear chars 1 to it of currentPathList end if --Convert the path list to a list of items get offset(";",currentPathList) while it > 0 set char it of currentPathList to "," get offset(";",currentPathList) end while --Search through the list, one path at a time while currentPathList is not NULL pop currentPathList into checkPath if last char of checkPath is not "\" put "\" after checkPath end if if fileExists(checkPath & fileNameToCheck) = 1 return checkPath end if end while --Unable to find file in the path return null original Search Path for File label ASYM_BeenHere Get Current Path Setting origPage original Get Current Path Setting< This script links to the function getDosEnvironmentString in TB40DOS.DLL to get the current DOS path setting. This handler returns the path currently specified in your DOS environment. Handler: findCurrentPath No parameters. RRath setting to get findCurrentPath --Link to the tb40dos dll linkDLL "tb40dos.dll" STRING getDOSEnvironmentString (STRING) end linkDLL --Get the path list set currentPathSetting to getDOSEnvironmentString ("PATH") return currentPathSetting end findCurrentPath Get Current Path Setting label ASYM_BeenHere Get Current Path Setting Remove given char from string Convert textlines to list Insert/Overwrite field origPage original Insert/Overwrite field label ASYM_BeenHere Insert/Overwrite field The upper field toggles between insert and overwrite mode when you press the insert key, the lower field indicates the mode. All handlers are in the fields. Type in the field to the right. Pressing the insert key toggles between insert and overwrite modes. The small field below reports the current mode. insert/overwrite overWriteFlag false keyDown overWriteFlag keyChar overWriteFlag enterpage 4logical overWriteFlag Y <> notifybefore notifyafter Now is the time for all good men to come to the aid of their country.s............................................wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww Toggle overWriteFlag keyDown overWriteFlag enterPage notifyAfter 4LOGICAL overWriteFlag Insert_Overstrike_Toggle tbk_wid_name terPage keyDown enterPage enterpage ,&H.& RPhT` Auto-scroll field Converting to Binary, Hex, Octal intro Dragging Objects label ASYM_BeenHere Dragging Objects5 Put the script below in an object that you want to drag with the mouse. Handler: buttonDown Parameters: loc (location of mouse click) to handle buttonDown loc local stack bnds,mouseOffset linkdll "user" int getsystemmetrics(int) -- check if the user has swapped mouse buttons. if getSystemMetrics(23) >0 set leftMouseButton to keyRightButton else set leftMouseButton to keyLeftButton set bnds to bounds of target set mouseOffset to item 1 of loc - item 1 of bnds,\ item 2 of loc - item 2 of bnds leftMouseButton=keyLeftButton while keyState(leftMouseButton)is down newloc = sysMousePosition if newLoc <> loc set position of target to \ item 1 of newLoc-item 1 of mouseOffset,\ item 2 of newLoc-item 2 of mouseOffset set loc to newLoc end if end while end buttonDown Display 2-D array values Testola description only subtopicname in,ms ThreeDeeRect bottomLine topLine explanation 9505100024541471761132477470 ASYM_TpID Converting to Binary, Hex, Octal origPage original Converting to Binary, Hex, Octal label Converting to Binary, Hex, Octal The Format command has been extended to allow conversion between Binary, Hex, and Octal number systems. The following are the new format strings Binary: "@b" Octal: "@o" Hex: "@h" Decimal: "@d" These strings precede the normal number format string. So to convert a variable "n" from decimal to hexidecimal, you could use the following command: format number n as "@h0" To convert it back to decimal, you'd do this: format number n as "@d0" from "@h0" is "Hexidecimal" format number numberEntered as "@h#" else format number numberEntered as "@o#" end conditions return numberEntered end doConversion ASYM_BeenHere Binary Insertion of Textline origPage original Binary Insertion of Textline label Binary Insertion of Textline into Field Inserts a textline into a string delimited by CRLFs, maintaining sorted order. Handler: InsertLine (,) Parameters: Text, sorted by textLine The new line to insert. Example of use: text of field "f" = insertLine(text of field "f",newLine) -- use if inserting a single line. Will maintain sorted order to get insertLine txt,newLine if txt is null return newLine set start to 1 -- first textline set tlc to textlinecount(txt) set ending to tlc -- last textline local insertSpot while start <= ending set midPoint to (start+ending) div 2 set middleLine to textline midPoint of txt conditions when newLine < middleLine as text -- start looking at values less than current midPoint set ending to midPoint-1 set insertSpot to midPoint when newLine > middleLine as text -- start looking at values greater than current midPoint set start to midPoint+1 set insertSpot to midPoint+1 else -- the item already exists set insertSpot to midPoint break while end if insertSpot > tlc put newLine before textline insertSpot of txt else put newLine&crlf before textline insertSpot of txt return txt ASYM_BeenHere ASYM_BeenHere label Making mmSource-paths book relative If you've saved your clips with fully qualified paths to their source files, you will probably want to change them so that they are relative to the location of the book so that the clips can be easily found using the HDMediaPath or CDMediaPath when installed on another machine. This routine runs through your resources and makes them relative to the book path. For example: If the book is "c:\toolbook\animals.tbk" mmSource "c:\toolbook\howl.wav" becomes "howl.wav" mmSource "c:\toolbook\wave\moo.wav" becomes "wave\moo.wav"""""""av" -- This handler is useful for eliminating fully qualified -- path names of the mmsource of clips. Instead, the path -- names will be relative to the book path. -- For example: -- if you had clips with the following paths specified as -- their mmSources -- c:\mtb40\dog.wav -- c:\mtb40\data\cat.wav -- calling this function from a book in the "c:\mtb40" -- directory would change these to the following: -- dog.wav -- data\cat.wav -- Once you've done this, you still need to set the -- hdMediaPath to the book path (on enterApplication, -- for example) to allow any clips located below the book -- path in the directory tree to be found. to handle relateClipsToBookPath if name of this book is null break linkdll "tb40dos.dll" int setcurrentdirectory(string) int setCurrentDrive(string) string getCurrentDrive() string getcurrentDirectory(string) path = myPath() -- cache current drive and directory curDrive = getCurrentDrive() curdir = getCurrentDirectory(curDrive) -- attempt to change to specified path a = setcurrentdrive(first char of path) b = setcurrentdirectory(path) -- both functions above return 1 if successful, -- or a negative number if not if a + b <> 2 -- if either function failed request path && "is invalid." else -- add slash to end put "\" after path clipList = resourceList("clip",this book) -- walk through clips, checking if any are under path step i from 1 to itemcount(clipList) pop clipList into curClip src = mmsource of curClip if src contains path -- it is under path, so drop first part clear chars 1 to charcount(path) of src mmsource of curClip = src mmSearchHD of curClip = true -- or mmSearchCD end end -- return current directory to original value get setcurrentdrive(curDrive) get setcurrentdirectory(curDir) to get myPath get name of this book step i from charcount(it) to 1 by -1 if char i of it is "\" return chars 1 to i-1 of it end return null -- happens only when the book is untitled Making mmSource-paths book relative wwwwp wwwwp wwwww wwwwwp TTTTP EDEEP TDDTP STATUSBARf CREATESPLASHWNDg wwwwww wwwww Using windows pointers windows m origPage original Using windows pointers The following functions are helpful if you need to allocate a pointer for calling a windows function. getWinPointer ( ) Use this to get a locked pointer. Parameter: : the size in bytes to allocate Return value: Returns a reference to a locked pointer that you can pass to a windows function requiring a pointer. freeWinPointer () Frees a locked pointer, recovering memory. Parameter: : the variable returned from getWinPointer() Return value: Returns 0 if successful, a positive integer if not. linkMemFunctions Links the functions necessary for the above handlers. Parameters: None.....rs: None. -- the link statements for needed functions below to handle linkMemFunctions linkDLL "KERNEL" WORD GlobalAlloc(WORD,DWORD) WORD GlobalFree(WORD) WORD GlobalHandle(WORD) POINTER GlobalLock(WORD) WORD GlobalUnlock(WORD) to get getWinPointer nSize local word hMem local retValue hMem = GlobalAlloc(66,nSize) return GlobalLock(hMem) to get freeWinPointer pMem local word hMem, retValue hMem = GlobalHandle(item 1 of pMem) retValue = GlobalUnlock(hMem) return GlobalFree(hMem) enddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd Using windows pointers label ASYM_BeenHere Using a RECT structure origPage original Using a RECT structure label Using a RECT structure_ The following functions are useful for dealing with windows functions that require or return a RECT structure. setRect , This sets the values of the RECT structure in pRect. Useful if you must pass a filled RECT structure to a Windows function. Parameters: : The vertices of the rectangle. : The pointer to the RECT structure. (8 bytes) getRect This extracts the vertices from a filled RECT structure. Parameter: : The pointer to a RECT structure. (8 bytes) getWinPointer ( ) Use this to get a locked pointer. Parameter: : the size in bytes to allocate Return value: Returns a reference to a locked pointer that you can pass to a windows function requiring a pointer. freeWinPointer () Frees a locked pointer, recovering memory. Parameter: : the variable returned from getWinPointer() Return value: Returns 0 if successful, a positive integer if not. linkMemFunctions Links the functions necessary for the above handlers. Parameters: None.....Functions Links the functions necessary for the above handlers. Parameters: None...e.y for the above handlers. Parameters: None. -- lst is a list of 4 integers -- pRect is a locked pointer to 8 bytes to handle setRect lst,pRect step i from 0 to 6 by 2 pop lst get pointerInt(i,pRect,it) -- pRect is a locked pointer to 8 bytes to get getRect pRect local retval step i from 6 to 0 by -2 push pointerInt(i,pRect) onto retval return retval -- the link statements for needed functions below to handle linkMemFunctions linkDLL "KERNEL" WORD GlobalAlloc(WORD,DWORD) WORD GlobalFree(WORD) WORD GlobalHandle(WORD) POINTER GlobalLock(WORD) WORD GlobalUnlock(WORD) to get getWinPointer nSize local word hMem local retValue hMem = GlobalAlloc(66,nSize) return GlobalLock(hMem) to get freeWinPointer pMem local word hMem, retValue hMem = GlobalHandle(item 1 of pMem) retValue = GlobalUnlock(hMem) return GlobalFree(hMem) enddddddddddddddddddd return GlobalFree(hMem) ASYM_BeenHere Sorting a 2-D array origPage original Sorting a 2-D array label Sorting a 2-D array Think of a 2-D array as a table in which the first dimension refers to rows and the second dimension refers to columns. This function sorts the "rows" of a two dimensional array by the values of one of its columns. You pass it the array you want to sort, the column you want to sort by, and the "datatype" of the column you want to sort. (Either "text", "date", or "number")/ Click on the radio buttons to the right to sort the table by the associated column. Note: the "table" to the right is a tab-delimited field with two vertical lines drawn over it. The handlers in the buttons load this text into a 2D array and pass it to a handler in this page, specifying the column and type for the sort. rt. stwoDquickSort sortField buttonclick buttonclick Zretval Zx[][] fref "sortField" fill x g] order calls the sorting routine. Note column 'array specified, be sorted twoDquickSort x,1," part loads dimensions(x) x[i][j] Number stwoDquickSort number sortField buttonclick buttonclick Zretval Zx[][] fref "sortField" fill x g] order twoDquickSort x,2," dimensions(x) x[i][j] Number stwoDquickSort sortField buttonclick buttonclick Zretval Zx[][] fref "sortField" fill x g] order twoDquickSort x,3," dimensions(x) x[i][j] Sort by: sortField a 3 5/23/91 b 2 3/11/92 c 4 4/1/06 d 9 11/13/66 e 0 7/4/76 f 6 7/7/64 g 7 4/1/23 h 1 2/9/55 i 5 3/1/29 a 8 1/12/93 ASYM_BeenHere Using a RECT structure isLeapYear() Get number of days in month Key Up Key Down Enter Key lo Right Up Enter Key lo Right Down Enter key lo Left Up Enter key Lo Left Down Enter Key hi Left Up Enter key hi Left Down Enter Key hi Right Up Enter key hi Right Up Key Up Left Key Down Left Key Up Right Key Down Right Key Up Center Key Down Center dragApple dragOrange Get path of current book label Get path of current book to get myPath get name of this book step i from charcount(it) to 1 by -1 if char i of it is "\" return chars 1 to i of it end return null -- happens only when the book is untitled This function returns the path of the current book. Example of calling this function in a book called c:\books\test.tbk: get myPath(this book) Returns "c:\books\"" ASYM_BeenHere invertedButton .isChild NON-ALPHA ,toggleInvert invertedButtonClass ALPHA txClassName label buttonStillDown buttonDoubleC resize Get Free Disk Space on a Drive origPage original Get Free Disk Space on a DriveB This script links to the function called getFreeDiskSpace in the tb40dos.dll to get the amount of disk space currently available on a particular drive. Handler: findDiskSpace () Parameters: the name of the drive to check Returns the amount of space available on a particular drive..ror ve an error to get findDiskSpace whatDrive local LONG diskSpaceAvailable --Link to the tb40dos dll linkDLL "tb40dos.dll" LONG getFreeDiskSpace(STRING) end linkDLL set diskSpaceAvailable to getFreeDiskSpace(whatDrive) return diskSpaceAvailable Get Free Disk Space on a Drive label ASYM_BeenHere Get Free Disk Space on a Drive Exit and restart windows Insert/Overwrite field Recording wave files from CD label ASYM_BeenHere Recording wave files from CD You can record clips from a CD to wave files using the utility below. Copy the object to a book with some clips, and then specify the channels, sample rate, bits per sample, and file name. This group of objects will record an existing CDAudio clip to a wave file on the disk. NOTE: must have your CD Player connected to your sound board for this function to work.... Clip Chooser CdresetContents enterpage CdresetContents clips whatClip CDAudio resetContents notifyBefore resetContents notifyAfter [dropdownitems clips = resourceList( <> NULL whatClip mmSource = "CDAudio" 6&CRLF "&"E& dropDownItems D:\HOOKWORK\CLIPS.TBK lookBook clip "CD Audio" clip "CD Audio" Channels Stereo 2 Mono 1 Stereo 2 sample rate 22 kHz 22050 11 kHz 11025 22 kHz 22050 44 kHz 44100 bits/sample 16z 11025 22 kHz 22050 44 kHz 44100 Record Wavefile Record Wavefile CDAudio Clip to Record Channels Sample Rate Bits/Sample enterpage Convert textlines to list origPage original Convert textlines to list label Convert textlines to list This handler converts a string delimited by CRLFs to a list. Handler: textLinesToList () Parameters: a string delimited by CRLFs Returns a list, each item representing a textline................. -- converts string delimited by CRLFs to a list to get textLinesToList txt local stack lst step i from textlinecount(txt) to 1 by - 1 push textline i of txt onto lst return lst ASYM_BeenHere Exit and restart windows Exit and restart windows label --When restart is true, Windows will exit and restart. --If restart is null or false, Windows will just exit. to handle exitWindows restart linkDLL "user" INT ExitWindows (DWORD, INT) end linkDLL if restart is true get ExitWindows (66, 0) else get ExitWindows (0, 0) end -- You can also use "67" to reboot the machineeee get ExitWindows (67, 0) end end end end buttonUp nd buttonUp nd buttonUp Calling this handler will cause Windows to exit. You can optionally specify that Windows restarts after exiting. Handler: exitWindows Parameters: True if you want to restart Windows n Windows will just Exit. origPage original Exit and restart windows ASYM_BeenHere Get day of week from date Get day of week from date label -- returns the weekday of any day beyond 1/1/1700: -- note: requires full year. Example: get weekDay("1/1/1993") -- also requires isLeapYear() function below to get dayOfWeek pdate -- make a list out of the date format date pdate as "m,d,y" from "m/d/y" set m to item 1 of pdate set d to item 2 of pdate set y to item 3 of pdate -- the following list (1 item for each month) contains the -- number of days that have passed before first day of -- each month. set days to "0,31,59,90,120,151,181,212,243,273,304,334" -- set numdays to number of days elapsed since 1/1/1700 set numdays to (y-1700) div 4-(y-1700) div 100 +(y-1600) \ div 400 + 365 * (y - 1700) + item m of days + d -1 if isLeapYear(y) and m <= 2 decrement numdays by 1 end set n to (numdays-2) mod 7 +1 return item n of \ "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday" -- Returns TRUE if y is a leap year, FALSE if not. -- NOTE: this fuction requires a four digit year. -- Example: Find out if 1992 is a leap year. -- if leapYear(1992) to get isLeapYear y if ((y mod 4 = 0 and y mod 100 <> 0) or (y mod 400 = 0)) return TRUE else return FALSE urn TRUE else return FALSE This handler returns the day of the week (Monday, Tuesday, etc) from any given date since 1/1/1700. Note that you must provide a four-digit year. Note that this function requires the handler isLeapYear, included below. Handler: dayOfWeek() Parameters: A date in this format: "1/1/1994" (Note a four-digit year is required.) year is required.) origPage original Get day of week from date ASYM_BeenHere isLeapYear() isLeapYear() label This function returns true if a given date is a leap year, false if not. Note that it requires a four digit year. Handler: isLeapYear () Parameters: : a four-digit number representing a year -- Returns TRUE if y is a leap year, FALSE if not. -- NOTE: this fuction requires a four digit year. -- Example: Find out if 1992 is a leap year. -- if leapYear(1992) to get isLeapYear y if ((y mod 4 = 0 and y mod 100 <> 0) or (y mod 400 = 0)) return TRUE else return FALSE origPage original isLeapYear() ASYM_BeenHere ND, OR, and XOR AutoPageName Sorting a 2-D array intro SubtopicName 95051000040014592225940240 ASYM_TpID Simple Drop Down Field Remove trailing spaces origPage 10,14 selectChars original label Introduction This book is a library of scripts and objects useful in OpenScript programming. To go to a given topic, click a topic in the list. To view topics related to a given category, choose the desired category. Use the search button to search for a topic by key word. Use the splitter bar to resize the navigation panel to the left. Note: you can add new topics to this book by pressing F3 (to enter author mode) and using the topic buttons that appear at the lower left.appear at the lower left. Yes, this is a button. buttonclick buttonclick "Yes, Yes, this is a button. buttonclick buttonclick "Yes, out,true ThreeDeeRect bottomLine topLine OpenScript Libraryy Base ASYM_BeenHere Binary Insertion of Textline scriptChooserDialog ButtonStillDown Page Navigation ButtonStillDown Page Navigation These simple scripts implement multiple page navigation when the mouse button is held down. Handlers: buttonDown buttonStillDown No parameters none ering actions (ie - called XXbuttonDown rather than buttonDown) Handlers in this script are: buttonDown Parameters are: none to handle buttonDown go to next page end buttonDown to handle buttonStillDown send buttondown end buttonStillDown tonDown to handle XXbuttonStillDown send buttondown end XXbuttonStillDown origPage original ButtonStillDown Page Navigation label ASYM_BeenHere Play clip in a loop label ASYM_BeenHere Play clip in a loop If you want to have a wave or midi file constantly repeat in the background, use the scripts below.pts Pressing the Play Clip button will play the specified clip continuously.uously. Clip Chooser CdresetContents enterpage CdresetContents clips whatClip resetContents Stop Clip play clips closed jwhatClip Play Clip selectChange notifyBefore resetContents notifyAfter [dropdownitems clips = resourceList( <> NULL whatClip &CRLF r"&"E& dropDownItems selectChange B"play " = "Stop mmStatus ") <> "closed" mmClose ( " = "Play D:\HOOKWORK\CLIPS.TBK lookBook clip "Asymetrix Logo" clip "Asymetrix Logo" clip "bird1" clip "bird2" clip "bird3" clip "CD Audio" clip "Chirp" clip "lion" clip "No No No" clip "tiger" clip "toad" Play Clips clip "bird2" whatClip Play Clip Clip to play continuously enterpage leavePage calMonth calYear displayDate Navigation Check for State Abbreviation Auto-scroll Field origPage original Auto-scroll Field label ASYM_BeenHere Auto-scroll Field This field's scrollbar automatically appears when necessary. Type in the field to the right. When appropriate, scroll bars will automatically appear. zashowOrHideScrollbar enterPage zashowOrHideScrollbar leaveField zashowOrHideScrollbar keyUp zashowOrHideScrollbar paste zashowOrHideScrollbar zashowOrHideScrollbar clear showOrHideScrollbar notifyBefore showOrHideScrollbar notifyAfter Widgets are stand-alone objects that can be copied and pasted into your applications. In most cases they are designed to work without modification of any scripts. dfg dfg enterPage rPage clear leaveField keyUp paste description and example 9505100015091465911961295454 ASYM_TpID SubtopicName in,ms ThreeDeeRect bottomLine topLine explanation .', " scrolling rectangle explanation enterpage notifyBefore fref "explanation" txtOver 8= 0 Example: in,sculpted ThreeDeeRect bottomLine topLine View Scripts details author reader author dotted enterpage notifybefore buttonclick Copy Objects group Copy Object enterPage buttonclick notifyBefore ) > 1 K= "Copy Objects" Copy Objects author reader enterpage keyUp paste clear leaveField 950510195057217149960457500199 ASYM_TpID Search and replace in a string function searches txt occurrences searchString replaces freplaceString. -- If asWord Conly where Tappears -- (A defined that preceded followed -- either beginning -- wordDelimit common punctuation mathematical operators.) searchReplace txt,searchFor,replaceWith, -- runningTotal = 1 -- totalChars= -- searchLen= -- replaceLen= -- -- are legally adjacent -- -- = " " & k& "-+*/<>,()[];^=&.?':" & curTxt -- curOffset = -- -- startPos = ( -- endPos = ( -- -- test occurance isolated y- 1) \ + 1 \ -- -- -- -- origPage original Search and replace in a string label ASYM_BeenHere Search and replace in a string This page contains a function that searches text for all occurrences of one string and replaces them with another. You can specify that you only want to replace the searched string if it's a whole word. handler: searchReplace(,,,) Parameters: : the string you'll be searching in : the substring you're looking for : the substring you want to replace for : "true" if you want to replace only whole words. Returns modified text odified text ext>: the string you'll be searching in : the substring you're looking for : the substring you want to replace for : "true" if you want to replace only whole words. Returns modified text elimit = " " & tab & crlf & "-+*/<>,()[];^=&.?':" & quote while runningTotal <= totalChars set curTxt to chars runningTotal to totalChars of txt curOffset = offset(searchFor,curTxt) if curOffset = 0 break while else startPos = (runningTotal+curOffset-1) endPos = (runningTotal+curOffset+searchLen-2) if asWord is true -- test if this occurance is an isolated word: if not ((startPos = 1 or char (startPos - 1) \ of txt is in wordDelimit) and\ (endPos = totalChars or char endPos + 1 \ of txt is in wordDelimit)) increment runningTotal by curOffset+searchLen-1 continue while end end set chars startPos to endPos of txt to replaceWith increment runningTotal by curOffset+replaceLen-1 increment totalChars by replaceLen - searchLen end return txt replaceLen - searchLen end return txt Try searching and replacing various words in the paragraph to the right. Note: when the As Word button is checked, only strings that exist as whole words in the text will be substituted.............. searchReplace The quick red fox jumped over the lumpy log. The fox, being inquisitive by nature and not really in any hurry, stopped to examine the underside of the log in an olfactory sort of way. "Those blasted dogs," he thought to himself. "Who do they think they are?" Seconds later he was ripped to shreds.hreds. searchString replaceString rabbit Search Textng Replace Textng searchAndReplace Search and Replace asWord As Word Playing random sounds label ASYM_BeenHere Playing random sounds Here is an example of playing clips at random. This could be used if you wanted to create ambient background noises. This button will randomly play the selected clips in the background. Play Clips FALSE isPlaying delay 1,2,3,4,5,6 clipList clip "tiger" whatClip Stop Clips Select clips to play randomly Clip Chooser CdresetContents enterpage CdresetContents .'+ +F clips whatClip default resetContents notifyBefore resetContents notifyAfter e= TRUE clips = resourceList( <> NULL whatClip SPACE& i"&"E& graphic = bitmap (mmMediaType CRLF e= FALSE = default clip "Asymetrix Logo" clip "No No No" clip "toad" clip "tiger" clip "lion" clip "bird3" clip "bird2" clip "bird1" clip "CD Audio" clip "Chirp" animation digitalVideo bitmap cdAudio sequencer photoCD videoDisk waveAudio overlay RadioButtons play clips delay buttonclick buttonclick delay B"play clips" = Often Normal 20000 Rarely How often enterPage leavePage Remove trailing spaces Remove trailing spaces label This function removes all trailing spaces, as well as other undesirable characters. Handler: trim() Parameters: The string from which you want to remove the trailing stuff. Returns the modified string -- removes trailing spaces, tabs, and crlf's to get trim strng local charsToDrop set charsToDrop to space & crlf & tab while charcount(strng) > 0 and last char of strng is in charsToDrop clear last char of strng return strng origPage original Remove trailing spaces ASYM_BeenHere Standard ToolBook messages enterApplication -- link needed dll's linkDLL "tb40win. displayBitsPerPixel() -- these gdi calls are used drawing separator getDeviceCaps( moveTo( lineTo( setROP2( gcreatePen( deleteObject( gselectObject( Xuser ggetDC( releaseDC( e"Using &Template" alias "helpTemplate" fhelptext\ "Displays 4 on template." backcolor (a " " handler, below) depending on -- the colors displayed. numColors() > 16 darkerBlue() lighterBlue() "navigationBar" -- initialize combobox "categories" " l x, l, ((l+r) (l+1) test i][n] < l][n] i][n] < l][n] i][n] < l][n] stbk_noswap , l, -1,n, , lst+1,r,n, a, b farray[a][i] b][i] b][i] mydir = sen = sysErrorNumber se = ss = bref = u&"tmplhelp.tbk") 1= ss "Cannot 8TMPLHELP.TBK" vref = defaultpage "cbt4" r= se -- returns the weekday beyond 1/1/1700: -- note: requires full year. Example: weekDay("1/1/1993") -- also 8isLeapYear() function below : pdate aa list out %"m,d,y" "m/d/y" following each month) days that have passed &o "0,31,59,90,120,151,181,212,243,273,304,334" numdays ielapsed since 1/1/1700 (y-1700) y4-(y-1700) y100 +(y-1600) \ y400 + 365 * (y - 1700) + + d -1 m <= 2 k7 +1 "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday" -- Returns TRUE a leap , FALSE -- NOTE: fuction a four digit Find 1992 leapYear(1992) k4 = 0 k100 <> 0) k400 = 0)) notifybefore showOrHideScrollbar notifyAfter --obj = J"details" "> 0 -- Displays scripted }on the allowing users their scrips buttonclick Zretval sysRuntime = "Scripts cannot be viewed qruntime version Multimedia ToolBook." -- reference appear dlgPage "scriptChooserDialog" -- list getObjectList( currentobject nameRef(currentObject) & ) = 1 obref "scriptObjects" %modal -- display "friendly obtype obname -- keep mind that arrays are passed Hreference, Hvalue twoDquicksort fArray[][] 2sortColumn,dtype 4stbk_noSwap twoDquicksrt C, 1, dimensions( lo, hi, hi > lo , lo, ((lo+hi) (lo+1) test stbk_noswap , lo, lst-1, +1,hi, Ztemp farray[a][i] b][i] b][i] "searchReplace" searchString replaceString asWord function searches occurrences replaces -- If only where appears -- (A defined that preceded followed -- either beginning txt, -- wordDelimit common punctuation mathematical operators.) usearchFor,replaceWith, runningTotal = 1 totalChars= searchLen= replaceLen= are legally adjacent = " " & k& "-+*/<>,()[];^=&.?':" & curTxt curOffset = startPos = ( endPos = ( -- test occurance isolated p- 1) w+ 1 "hour" "Minute" "AMPM" minute value #+ 1) %"00" %"00" < 0 > 59 outside range 0 %"00" k12) + 1 %"00" %"00" < 1 > 12 &&"out %"00" + 1) %"00" %"00" < 0 > 59 %"00" initialize 4OBJECT newHotwordID %"hh : j: sec buttonClick whatClip = combobox "clip chooser" $NULL "Please xmmPlayable "This Smay cannot be played oldTimeFormat = mmTimeFormat channels = samples = rate" bitsPer = startSpot = mmBeginPoint stopSpot = mmEndPoint callMCI(" qtype waveaudio alias waveFile buffer 5","") " && 0samplespersec" && Qitspersample" && tinput","") record ","") ","") cTRUE ("Enter a file fileName FALSE filename && "already exists. Try a different f"&OK" "&Cancel" && " f"&OK" " && "Would you like hear" && && "now?" f"OK" close default buttonClick whatClip = combobox "clip chooser" 1NULL "Please xmmPlayable "The specified iannot be played = "Stop mmStatus ) = "p" mmStop ( "closed" mmOpen mmMediaType "cdAudio" "waveAudio" "sequencer" mmplay notify hold mmnotify , whatCommand, whatStatus = "successful" notifyBefore <> CLOSED mmClose notifyAfter buttonClick selectedtextlines "clip chooser" = NULL "Please isPlaying = FALSE Clips" = "Stop timernotify timerId timerStop( timerID notifyBefore mmClose mmnotify whatClip, whatCommand, whatStatus = "mmplay" = "successful" = timerStart("single", (delay ),500, whatLines = howMany = whichOne = (howmany) mmPlayable &&"could xbe played." buttonclick loc, isShift linkdLL "tb40win.dll" STRING SetWinIniVar ( 8dlg. +OpenFileDlg ( C,INT) whatItem = combobox "clip chooser" path=pathFromFile( "filename") newFile = ("Select wavefile ,fileFromPath( [,"Wave,*. .", 1) ("sounds", r&","& resetContents unlinkDLL function "tb40dlg. Vi+1 notifyBefore resetContents notifyAfter linkDLL "tb40dlg.dll" STRING listToTextline ( linkdLL "tb40win. 4 GetWinIniVar ( [dropdownItems soundList = getWinIniVar("sounds","") -ds", -- the Uhas a problem, returning empty there are a lot entries. 255 Rlimit? &TAB& &CRLF K","& a","& extra selectedItem whatWave = dropdownitems "filename" = unlinkDLL function selectChange whatText buttonClick whatClip = combobox "clip chooser" %<> NULL (whatclip && " 8" && & (whatBook =) & "Please xmmPlayable "The specified annot be played mmStatus "playing" mmStop X"tb40win.dll" INT mmYieldApp () mmVolume "display"*2 notify notifyAfter dialMove value mmnotify Xfunction " notifyBefore -- Charles Hiestand & Tim Pearson, Asymetrix 1/94 Ctrl+Shift+Click used %the panic kill hung MIDI notes /sustain pedal, which sustains a #roperty = does xunlink ~dlls except dialog box. { loc, isShift, isCtrl 4 s_channel, s_device, s_currentKey ZSTACK objs openMIDI A <> gli = ogliss playMIDI ) = "down" objectFromPoint( xsus stopMIDI = FALSE = TRUE <> NULL 4 s_hMidiOut, MidiOutShortMsg( &packDword(192 + oprogram,0)) %44 + ovolume)) "Unable 28 + Z pMem X"KERNEL" WORD GlobalAlloc ( ,DWORD) POINTER GlobalLock ( ! Globalhandle ( R GlobalUnlock ( i GlobalFree ( linkDLL X"mmsystem.dll" midiOutOpen ( MidiOutReset ( MidiOutClose ( MidiOutGetNumDevs () closeMIDI %() <= 0 devices found" = getWinPointer(32) MidiOutOpen( 0,0,0) freeWinPointer( nSize hMem Z retValue bitAnd 0x0000FFFF selector. GlobalUnLock( "Memory error occured. Operation Aborted." packDWord a, b, c a + (b * 256) + (c * 65536) notifyAfter notifyBefore customEdit obj oeditWidget = -- "val" will always be 's there %part " syntax. init, sysToolBookDirectory & "tb40dlg. STRING Dialog SetValue ( 1 GetValue ( "mmSystem. odlgInit," = i - 1 + 1) "comboBox = i - 1 + 1) = i - 1 + 1) = i - 1 + 1) odlgBox, getValue( Bok") = | = q = -- You can also these directly "mtb40.sbk" sysbook. unlinkDLL y & " -- Charles Hiestand 6/94 -- MIDI expects a code (status 2 data bytes each MidiOutShortMsg(). Windows see these 5 packed a dWord -- analogous $ way :packs colors. wants M high nibble f channel F, depending on , one -- Table "Channel Voice Messages": -- + low -- 0x80 = note off, , volume -- 0x90 = 1, N.B. ) = 0 == -- 0xA0 = poly key pressure value -- 0xB0 = control change, -- 0xC0 = program -- 0xD0 = -- 0xE0 = pitch bend, lsb , msb can take a 0 - 15; : 0 - 127; : 0 - 127; : 0 - 127 : 0 - 120; : 0 - 127 -- This only uses 0x80, 0x90, -- For more information, standard specification { loc, isShift, isCtrl 4 INT s_hMidiOut, s_program, s_channel, s_note, s_volume ZSTACK objs -- initialize parameters V" -- try changing 's great fun w = 0 -- won't zmuch " -- kind like, which on a piano = 127 -- , how hard -- panic openMIDI device playMIDI stopMIDI the that comment your -- packDword a function found later thing, message actually plays "Unable 4 s_device, Z pMem X"KERNEL" WORD GlobalAlloc ( ,DWORD) POINTER GlobalLock ( C GlobalUnlock ( Z GlobalFree ( linkDLL X"mmsystem.dll" midiOutOpen ( MidiOutReset ( MidiOutClose ( MidiOutGetNumDevs () closeMIDI %() <= 0 devices = getWinPointer(32) MidiOutOpen( ,0,0,0,0) freeWinPointer( <> NULL nSize hMem Z retValue Globalhandle( bitAnd 0x0000FFFF selector. GlobalUnLock( "Memory error occured. Operation Aborted." packDWord a, b, c a + (b * 256) + (c * 65536) notifyAfter notifyBefore odisablePage && " " && olevel) oenabled FALSE buttonClick " && value oprop_level "invalid widget:"&& G &CRLF&\ "must be "" direction "Next,Previous,First,Last" "", "" "", "" oprop_disablePage &CLRF&\ notifyBefore odisablePage && " " && olevel) oenabled FALSE buttonClick " && value oprop_level "invalid widget:"&& G &CRLF&\ "must be "" direction "Next,Previous,First,Last" "", "" "", "" oprop_disablePage &CLRF&\ notifyBefore odisablePage && " " && olevel) oenabled FALSE buttonClick " && value oprop_level "invalid widget:"&& G &CRLF&\ "must be "" direction "Next,Previous,First,Last" "", "" "", "" oprop_disablePage &CLRF&\ notifyBefore odisablePage && " " && olevel) oenabled FALSE buttonClick " && value oprop_level "invalid widget:"&& G &CRLF&\ "must be "" direction "Next,Previous,First,Last" "", "" "", "" oprop_disablePage &CLRF&\ key, isShift, isControl -- N numeric, A alpha, - seperator, anything templet = -- user property O = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" = "0123456789" = " ,.-/" caretLocation = characterTyped = o(key) characterNumber = ( buttonClick checkLinks drive = getCurrentDrive() selectFile $&":\"& getCurrentDirectory( A) &"\", W, FALSE uncheckLinks y, TRUE --notifyAfter updateFileInfo &activateInstance notifyBefore = path, file "*.*" fileList = getFileOnlyList( F, "", "N") linkDLL sysToolBookDirectory & "tb40dos.dll" STRING unlinkDLL iry & " --stub prevent no notifyhandlers message exist updateDirectoryInfo pathAndFile keep causing ES selectChange newDrive checkLinks = TRUE drive = setCurrentDrive( setCurrentDirectory( ;&":") updateDirectoryInfo Y&":.\" updateFileInfo s&":.\" selectFile &":.\" = FALSE uncheckLinks enterDropdown odropDownItems getDriveList() notifyBefore ZSTRING fileList linkDLL sysToolBookDirectory & "tb40dos.dll" bgetCurrentDrive() INT unlinkDLL try & " notifyAfter --stub prevent & handlers message exist pathAndFile notifyBefore checkLinks drive = getCurrentDrive() path = getCurrentDirectory( updateDirectoryInfo M&":.\" updateFileInfo g&":.\" setCurrentDirectory( &":.\"& &":.\" selectFile &":.\" &":.\" oselectedTextlines qrefCount DLLs requires leaving clean uncheckLinks ZSTRING fileList = getDirectoryOnlyList( &"*", "N") B = "."&CRLF&".." linkDLL sysToolBookDirectory & "tb40dos.dll" INT unlinkDLL pry & " notifyAfter --stub prevent no notifyhandlers message exist pathAndFile keep causing ES notifyBefore linkDLL "user" WORD widTimerStart=SetTimer( ,DWORD) +End = KillTimer( translateWindowMessage windowhandle on 0x0113 clockTick otimerID operiod * 1000, 0) notifyAfter widTimerEnd( unlinkDLL " hWnd, msg, value oprop_format buttonClick MaxSelection omaxNumber --This handler will limit the selectable lines --a multi- list box. Fcan be placed fwork fmore than one It takes parameter: Represents maximum selections allowed call following syntax: ZLVselectedLine ("Don't know . Please enter a positive integer." (selectedTextLines Target) > Num value isType(INT, -- here neatness, xreally necessary buttonClick XSelect --The allows exclusive 3handler will --multiple selections a list box %the specified xselected. --Once other lines --become unselected. Sort a single- uinside a This can be placed work fmore than one takes paramter: -- XLine: Represents call Xselect following syntax: ZLVsel ("Which Ushould we exclude?" omyNumber selectedTextlines (LVSel) selectedTextLines value isType(INT, onum "Please a positive integer." 4chrOffset, textBuff <> -1 @ = 0 ZnewOffset chOff tL <> -1 <> 0 <> 0 odefaultAllowDrag endDrag targetobject, pageLoc 4theSelectedText ( <> = "0,0" beginDrag notifyBefore notifyAfter 4INT s_WM_DROPFILES 0x0233 linkDLL "SHELL" 2DragAcceptFiles (WORD, DragQueryCount = DragQueryFile ( v, DWORD, ? DragQueryValue = , POINTER, KERNEL" | GlobalAlloc( 5 GlobalLock( GlobalUnlock( GlobalFree( (sysClienthandle,1) translateWindowMessage on filesDropped hwnd, wmsg, wp, lplo, lphi ZhMem, pMem = TRUE cleanUp l_count ( wp , -1 , 0, 0 ) objectFromPoint( ) <> ) = "dropFiles" 66,256) (wp, 0, , 256 ) 1(0, (wp, i-1, , 256) 1(0, ) & GlobalUnLock( objs = myCounter = 0 "OLE" I* 200 b* 200 = False unTranslateWindowMessage -- deal fdll refCount unlinkDLL " -- prevent E.S. xincluded "track" pinNumber() -- This handler jumps the slider each tick mark mouse moved Zarray x[5], -- find midpoint between lines renamed allow ;widgets on [i] = ((( U(i+6))-\ U(i+5)))/2 )+( U(i+5)) x[i] = ( U(i+5))-82 pos = < pin[1] "slider2" = x[1] When -- This handler jumps the slider each tick mark mouse moved Zarray x[5], pin[4] -- find midpoint between 0i] = ((( U(i+1))-\ Ui))/2 )+( x[i] = ( Ui)-82 pos = " = x[1] " = x[2] " = x[3] When " = x[4] " = x[5] -- moves the slider xPix sysPageUnitsPerPixel sliderMin sliderMax scale sliderBounds nearestPupp( oldP nearestPUPP( pos - oldMouseX sliderPos mysliderPos startSliderMove leftMButton primaryMouseButton() -- S-handed mousing newMouseX newP b(x1, 9-dx),x2-w) n-x1)* )/(x2-x1-w)+ sliderMove mySliderPos endSliderMove buttonClick linkDLL "USER" LockWindowUpdate(WORD) ZobjTracker rObj 5& "," hideWithTrans , "dissolve showWithTrans unlinkDLL " .pObjList, pTrans -- SHOW OBJECT LIST: xNULL) -- RESET , EAT PAINTING: sysClienthandle) lockWindowUpdate(0) -- TRANSITION TO THIS PAGE: transition -- Implementation transition FX individual -- Syntax: -- showWithTrans < {list>, < Eeffect> -- hideWithTrans < -- CJC buttonClick linkDLL "USER" LockWindowUpdate(WORD) , "dissolve ), "wipe unlinkDLL "user" pObjList, pTrans -- SHOW OBJECT LIST: xNULL) -- RESET , EAT PAINTING: sysClienthandle) lockWindowUpdate(0) -- TRANSITION TO THIS PAGE: key, isShift, isControl ZSTRING characterTyped = ansitoChar( numberDigits = "$-+(" --"$1234567890+-." s = "-" "1234567890.)" ~(")", ) --doesn't zanything -- let's asure the formatted correctly = TRUE sS = = FALSE "$(-" inTheRed ~(")", %"(" & sysCurrency & "#,##0.00" & ")" BLACK 7#0.00" = "###.##" "Error entry, please re-enter." objectFromPoint( isChild( toggleInvert obuttonPressed buttonClick FALSE toggleObject = TRUE oinvertedButton <> R <> objectInQuestion, parentInQuestion $ <> notifyAfter Zstack bnds,mouseOffset X"user" getsystemmetrics( * has swapped I buttons. =23) >0 leftMouseButton targ newloc = newLoc <> objectFromPoint( "base" dropTarget checkObject oorigLoc labelPosition value notifyBefore initQuiz moved -- 13,14 -- 11,12 9,10 sized pupp syspageunitsperpixel pwidth * 10 pheight * 10 topLeft mask topRight U"point" bottomLine sz > sz > syssuspendmessages distToP sz - -- returns a list two numbers: the followed zpossible. grade ZnumRight,totalNum objs 0 = label -- initializes quiz notifyBefore initQuiz objCount -- use you want store state answers -- that subject gave Zretval & "," & -- restores stored value. labelPosition -- moves labels their proper spots. showRightAnswers objName objLabel wrong original showWrongAnswers origLoc bnds checkObject labelObj "Correct!" "Nope." showing ,mode showObjs hideObjs dropTarget 4s_color,s_targ capital updateDisplay nm, Zlogical refresh -- we are still . If so, don't blank out -- (otherwise flashes annoyingly) newObj objectFromPoint( xsent going ,mode. notifyBefore state, just a stub handler, so no error occurs around deal message. -- a that displays value. xpix sysPageUnitsPerPixel sliderMin sliderMax scale sliderBounds nearestPupp( oldP nearestPUPP( pos - oldMouseX sliderPos mysliderPos startSliderMove newMouseX newP b(x1, 6-dx),x2-w) e-x1)* )/(x2-x1-w)+ sliderMove endSliderMove notifyBefore helptext statusbar = keyEnter selectChange ( = NULL oldCursor = urls = dropdownitems flag = CRLF& QUOTE& "NETSCAPE" "no server" exe = internetBrowser "shell.dll" WORD FindExecutable (STRING, POINTER) "tb40win. getMemBlock (DWORD) ZfreeMemBlock ( lpBuffer = @(256) >buttonClick status = ("blank.htm",sysToolBookDirectory, 2<= 32 "No browser could be located." & available on your 4, please associate the" && \ &"*. && "file extension >buttonclick = exe &&URL) buttonclick loc, isShift, isControl url = "URL" >buttonClick oldCursor = QUOTE& "NETSCAPE" "no server" exe = internetBrowser "shell.dll" WORD FindExecutable (STRING, POINTER) "tb40win. getMemBlock (DWORD) ZfreeMemBlock ( lpBuffer = @(256) status = ("blank.htm",sysToolBookDirectory, 2<= 32 "No browser could be located." & CRLF & available on your 4, please associate the" && \ &"*. && "file extension = exe &&URL) -- adds the navigation -- called on whenever 1combobox value -- Note: each will be like such: --